Remove unused FileSystemUtils#copyFile

This commit is contained in:
Simon Willnauer 2014-04-09 16:15:15 +02:00
parent a215dd3ae8
commit 0564c883be
1 changed files with 1 additions and 32 deletions

View File

@ -80,11 +80,7 @@ public class FileSystemUtils {
} catch (IOException ioe) { } catch (IOException ioe) {
int i = 0; int i = 0;
for (RandomAccessFile raf : files) { for (RandomAccessFile raf : files) {
try { IOUtils.closeWhileHandlingException(raf);
raf.close();
} catch (IOException e) {
// ignore
}
new File(testDir, "tmp" + i++).delete(); new File(testDir, "tmp" + i++).delete();
} }
if (dirCreated) { if (dirCreated) {
@ -229,33 +225,6 @@ public class FileSystemUtils {
throw exc; throw exc;
} }
public static void copyFile(File sourceFile, File destinationFile) throws IOException {
FileInputStream sourceIs = null;
FileChannel source = null;
FileOutputStream destinationOs = null;
FileChannel destination = null;
try {
sourceIs = new FileInputStream(sourceFile);
source = sourceIs.getChannel();
destinationOs = new FileOutputStream(destinationFile);
destination = destinationOs.getChannel();
destination.transferFrom(source, 0, source.size());
} finally {
if (source != null) {
source.close();
}
if (sourceIs != null) {
sourceIs.close();
}
if (destination != null) {
destination.close();
}
if (destinationOs != null) {
destinationOs.close();
}
}
}
/** /**
* Check that a directory exists, is a directory and is readable * Check that a directory exists, is a directory and is readable
* by the current user * by the current user