diff options
Diffstat (limited to 'org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java')
-rw-r--r-- | org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java index ffc7daaa339..7d88be8dd12 100644 --- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java +++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java @@ -34,27 +34,27 @@ import org.eclipse.core.filebuffers.FileBuffers; public class FileTool { - + private final static int MAX_RETRY= 5; - + /** * A buffer. */ private static byte[] buffer= new byte[8192]; - + /** * Unzips the given zip file to the given destination directory * extracting only those entries the pass through the given * filter. - * + * * @param zipFile the zip file to unzip * @param dstDir the destination directory * @throws IOException in case of problem */ public static void unzip(ZipFile zipFile, File dstDir) throws IOException { - + Enumeration entries = zipFile.entries(); - + try { while(entries.hasMoreElements()){ ZipEntry entry = (ZipEntry)entries.nextElement(); @@ -92,12 +92,12 @@ public class FileTool { } } } - + /** * Returns the given file path with its separator * character changed from the given old separator to the * given new separator. - * + * * @param path a file path * @param oldSeparator a path separator character * @param newSeparator a path separator character @@ -108,11 +108,11 @@ public class FileTool { public static String changeSeparator(String path, char oldSeparator, char newSeparator){ return path.replace(oldSeparator, newSeparator); } - + /** * Copies all bytes in the given source file to * the given destination file. - * + * * @param source the given source file * @param destination the given destination file * @throws IOException in case of error @@ -132,12 +132,12 @@ public class FileTool { is.close(); } } - + /** * Copies all bytes in the given source stream to * the given destination stream. Neither streams * are closed. - * + * * @param source the given source stream * @param destination the given destination stream * @throws IOException in case of error @@ -154,7 +154,7 @@ public class FileTool { /** * Copies the given source file to the given destination file. - * + * * @param src the given source file * @param dst the given destination file * @throws IOException in case of error @@ -180,13 +180,13 @@ public class FileTool { return null; } } - + public static File createTempFileInPlugin(Plugin plugin, IPath path) { IPath stateLocation= plugin.getStateLocation(); stateLocation= stateLocation.append(path); return stateLocation.toFile(); } - + public static StringBuffer read(String fileName) throws IOException { return read(new FileReader(fileName)); } @@ -220,12 +220,12 @@ public class FileTool { } } } - + public static void delete(IPath path) { File file= FileBuffers.getSystemFileAtLocation(path); delete(file); } - + public static void delete(File file) { if (file.exists()) { for (int i= 0; i < MAX_RETRY; i++) { |