X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fio%2FFileSystemUtils.java;h=384eb09e894f6cf2b698cffae0be0b4f895b2e49;hb=8de36ff0206c996baf3ee4adc3e2293b12ff5f39;hp=fd507caf41084334ed746ed6fa55a98dfcbe971e;hpb=ddd261f331280640c5b53c7128230b629ebcd268;p=utils diff --git a/support/general/src/test/java/org/wamblee/io/FileSystemUtils.java b/support/general/src/test/java/org/wamblee/io/FileSystemUtils.java index fd507caf..384eb09e 100644 --- a/support/general/src/test/java/org/wamblee/io/FileSystemUtils.java +++ b/support/general/src/test/java/org/wamblee/io/FileSystemUtils.java @@ -37,10 +37,9 @@ import java.nio.channels.FileChannel; import java.security.CodeSource; - /** * File system utilities. - * + * * @author Erik Brakkee */ public final class FileSystemUtils { @@ -58,7 +57,6 @@ public final class FileSystemUtils { /* * Disabled. - * */ private FileSystemUtils() { // Empty @@ -67,7 +65,7 @@ public final class FileSystemUtils { /** * Deletes a directory recursively. The test case will fail if the directory * does not exist or if deletion fails. - * + * * @param aDir * Directory to delete. */ @@ -77,7 +75,7 @@ public final class FileSystemUtils { /** * Deletes a directory recursively. See {@link #deleteDirRecursively}. - * + * * @param aDir * Directory. */ @@ -99,7 +97,7 @@ public final class FileSystemUtils { * Deletes a file or directory. The test case will fail if the file or * directory does not exist or if deletion fails. Deletion of a non-empty * directory will always fail. - * + * * @param aFile * File or directory to delete. */ @@ -111,7 +109,7 @@ public final class FileSystemUtils { * Gets a path relative to a sub project. This utility should be used to * easily access file paths within a subproject without requiring any * specific Eclipse configuration. - * + * * @param aRelativePath * Relative path. * @param aTestClass @@ -151,7 +149,7 @@ public final class FileSystemUtils { /** * Ensures that a directory hierarchy exists (recursively if needed). If it * is not possible to create the directory, then the test case will fail. - * + * * @param aDir * Directory to create. */ @@ -171,9 +169,13 @@ public final class FileSystemUtils { /** * Creates a file in a directory. - * @param aDir Directory path. Will be created if it does not exist. - * @param aName Filename. - * @param aContents Contents. + * + * @param aDir + * Directory path. Will be created if it does not exist. + * @param aName + * Filename. + * @param aContents + * Contents. */ public static void createFile(File aDir, String aName, InputStream aContents) { createDir(aDir); @@ -189,7 +191,7 @@ public final class FileSystemUtils { /** * Gets the test output directory for a specific test class. - * + * * @param aTestClass * Test class. * @return Test output directory. @@ -204,7 +206,7 @@ public final class FileSystemUtils { /** * Gets the test input directory for a specific test class. - * + * * @param aTestClass * Test class. * @return Test input directory. @@ -220,7 +222,7 @@ public final class FileSystemUtils { /** * Creates a directory hierarchy for the output directory of a test class if * needed. - * + * * @param aTestClass * Test class * @return Test directory. @@ -236,7 +238,7 @@ public final class FileSystemUtils { * Gets a test output file name. This returns a File object representing the * output file and ensures that the directory where the file will be created * already exists. - * + * * @param aName * Name of the file. * @param aTestClass @@ -267,7 +269,7 @@ public final class FileSystemUtils { /** * Copies an input stream to an output stream. - * + * * @param aIs * Input stream. * @param aOs @@ -291,7 +293,7 @@ public final class FileSystemUtils { /** * Recursively copy a directory. - * + * * @param aSrc * Source directory * @param aTarget @@ -310,8 +312,8 @@ public final class FileSystemUtils { if (file.isDirectory()) { if (!file.getName().equals(".svn")) { - copyDir(new File(aSrc, file.getName()), - new File(aTarget, file.getName())); + copyDir(new File(aSrc, file.getName()), new File(aTarget, + file.getName())); } } else { copyFile(file, new File(aTarget, file.getName())); @@ -321,7 +323,7 @@ public final class FileSystemUtils { /** * Copy a file. If copying fails then the testcase will fail. - * + * * @param aSrc * Source file. * @param aTarget @@ -336,7 +338,7 @@ public final class FileSystemUtils { // map input file MappedByteBuffer mbb = fcin.map(FileChannel.MapMode.READ_ONLY, 0, - fcin.size()); + fcin.size()); // do the file copy fcout.write(mbb); @@ -357,7 +359,7 @@ public final class FileSystemUtils { * This only attempts to remove regular files and not directories within the * directory. If the directory contains a nested directory, the deletion * will fail. The test case will fail if this fails. - * + * * @param aDir * Directory to remove. */ @@ -368,7 +370,7 @@ public final class FileSystemUtils { /** * Remove all regular files within a given directory. - * + * * @param outputDirName */ public static void cleanDir(File aDir) {