@@ -0,0 +1,2075 @@
+package com.navercorp.utilset.storage;%0A%0Aimport static org.hamcrest.CoreMatchers.*;%0Aimport static org.junit.Assert.*;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.File;%0Aimport java.io.InputStream;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.TemporaryFolder;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.RobolectricTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0A%0A%0A@RunWith(RobolectricTestRunner.class)%0A@Config(manifest = Config.NONE)%0Apublic class FileUtilsTest %7B%0A    @Rule %0A    public TemporaryFolder testFolder = new TemporaryFolder();%0A    String destFilePath;%0A    String fileName = %22test.txt%22;%0A%09String content = %22hello utilset%22;%0A    %0A    @Before%0A    public void setUp() throws Exception%7B%0A        File downloadFolder = testFolder.newFolder(%22download%22);%0A        this.destFilePath = downloadFolder.getAbsolutePath();%0A    %7D%0A    %0A    @Test%0A    public void shouldCreateFileAndGetContent()%7B%0A    %09// given%0A    %09InputStream inputStream = new ByteArrayInputStream(content.getBytes());%0A%0A    %09// when%0A%09%09boolean created = FileUtils.createAndCopyContentToFile(destFilePath, fileName, inputStream);%0A%09%09%0A%09%09// then%0A%09%09String path = destFilePath + File.separator + fileName;%0A%09%09assertThat(created, is(true));%0A%09%09assertThat(FileUtils.exist(path), is(true));%0A%09%09assertThat(FileUtils.getFileContent(path).trim(), is(content));%0A    %7D%0A%0A    @Test%0A    public void shouldDeleteFile()%7B%0A    %09// given%0A    %09InputStream inputStream = new ByteArrayInputStream(content.getBytes());%0A    %09FileUtils.createAndCopyContentToFile(destFilePath, fileName, inputStream);%0A    %09String path = destFilePath + File.separator + fileName;%0A%0A    %09// when%0A    %09boolean deleted = FileUtils.delete(path);%0A%0A    %09// then%0A    %09assertThat(deleted, is(true));%0A%09%09assertThat(FileUtils.exist(path), is(false));%0A    %7D%0A%0A    @Test%0A    public void shouldGetFalseWhenDeleteNonExistedFile()%7B%0A    %09// given%0A    %09String path = %22This is a wrong path%22;%0A%0A    %09// when%0A    %09boolean deleted = FileUtils.delete(path);%0A%0A    %09// then%0A    %09assertThat(deleted, is(false));%0A    %7D%0A%7D%0A

Add tests for FileUtils