Ignore:
Timestamp:
2005-02-18T12:31:54+13:00 (19 years ago)
Author:
mdewsnip
Message:

GLI applet: collection building is now much happier about being cancelled. By Matthew Whyte.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/GathererApplet.java

    r9092 r9095  
    4242import org.greenstone.gatherer.gui.GUIManager;
    4343import org.greenstone.gatherer.util.Utility;
     44import org.greenstone.gatherer.shell.GShell;
    4445
    4546
     
    208209
    209210
    210     static public void download_url_zip(String col_name, String dir)
     211    static public void download_url_zip(String col_name, String dir, GShell source)
    211212    {
    212213    try {
     
    247248        int len;
    248249
    249         while ((len = dl_dbis.read(buf)) >= 0) {
     250        while ((len = dl_dbis.read(buf)) >= 0 && !source.hasSignalledStop()) {
    250251        zip_bfos.write(buf,0,len);
    251252        }
     
    261262
    262263
    263     static public void upload_url_zip(String col_name, String dir)
     264    static public void upload_url_zip(String col_name, String dir, GShell source)
    264265    {
    265266    final String lineEnd = "\r\n";
     
    320321        // read file and write it into form...
    321322        int bytesRead = fileInputStream.read(buffer, 0, bufferSize);
    322        
     323
    323324        while (bytesRead > 0) {
     325        // Check to see if action has been cancelled.
     326        if (source != null && source.hasSignalledStop()) {
     327            break;
     328        }
    324329        dos.write(buffer, 0, bufferSize);
    325330        bytesAvailable = fileInputStream.available();
Note: See TracChangeset for help on using the changeset viewer.