Ticket #214 (new defect)

Opened 13 years ago

Last modified 11 years ago

test java.nio as as alternative file copy mechanism

Reported by: anonymous Owned by: nobody
Priority: moderate Milestone: Collection building wishlist
Component: GLI Severity: enhancement
Keywords: Cc:


public void copyFile(File source, File destination, boolean overwrite)

in FileQueue?.java

uses a buffer to copy files.

We should test whether this solution is quicker (it is probably more likely to be correct as well):


public static void copyFile(File sourceFile, File destFile) throws IOException {
 if(!destFile.exists()) {
 FileChannel source = null;
 FileChannel destination = null;
 try {
  source = new FileInputStream(sourceFile).getChannel();
  destination = new FileOutputStream(destFile).getChannel();
  destination.transferFrom(source, 0, source.size());
 finally {
  if(source != null) {
  if(destination != null) {

Change History

Changed 11 years ago by kjdon

  • component changed from Collection Building to GLI
  • severity set to enhancement
  • milestone set to Collection building wishlist
Note: See TracTickets for help on using tickets.