Remove unused FileSystemUtils#copyFile
This commit is contained in:
parent
a215dd3ae8
commit
0564c883be
|
@ -80,11 +80,7 @@ public class FileSystemUtils {
|
|||
} catch (IOException ioe) {
|
||||
int i = 0;
|
||||
for (RandomAccessFile raf : files) {
|
||||
try {
|
||||
raf.close();
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
}
|
||||
IOUtils.closeWhileHandlingException(raf);
|
||||
new File(testDir, "tmp" + i++).delete();
|
||||
}
|
||||
if (dirCreated) {
|
||||
|
@ -229,33 +225,6 @@ public class FileSystemUtils {
|
|||
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
|
||||
* by the current user
|
||||
|
|
Loading…
Reference in New Issue