Changeset 24859


Ignore:
Timestamp:
2011-12-06T12:00:15+13:00 (12 years ago)
Author:
sjm84
Message:

Implemented a much faster version of the move function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java

    r24720 r24859  
    3030import java.lang.ClassLoader; // to find files on the class path
    3131import java.net.URL;
     32import java.nio.channels.FileChannel;
    3233import java.util.ArrayList;
    3334
     
    219220    }
    220221
    221 
    222222    static public String interfaceStylesheetFile(String gsdl3_home, String interface_name, String filename)
    223223    {
     
    292292        return null;
    293293    }
    294    
     294
    295295    static public ArrayList<File> getStylesheetFiles(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList base_interfaces, String filename)
    296296    {
     
    511511                    FileInputStream in = new FileInputStream(input[i]);
    512512                    FileOutputStream out = new FileOutputStream(output);
    513                     int value = 0;
    514                     while ((value = in.read()) != -1)
    515                     {
    516                         out.write(value);
    517                     }
     513
     514                    FileChannel inC = in.getChannel();
     515                    FileChannel outC = out.getChannel();
     516
     517                    System.err.println(inC.transferTo(0, inC.size(), outC));
     518                   
    518519                    in.close();
    519520                    out.close();
     521
    520522                    // Delete file
    521523                    input[i].delete();
Note: See TracChangeset for help on using the changeset viewer.