Ignore:
Timestamp:
2005-07-28T15:50:17+12:00 (19 years ago)
Author:
mdewsnip
Message:

Tidied up a lot of path variables. These were all over the place, and were often duplicated. Now all GLI related paths are accessed via static methods in the Gatherer class.

File:
1 edited

Legend:

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

    r10259 r10342  
    627627            progress.messageOnProgressBar("Downloading CD-ROM data from server");
    628628            }
     629
     630            // !! TO DO
    629631           
    630             //Export directory derrived from -cdname argument
    631             //This needs to be exactly the same as derrived by exportcol.pl - perhaps it should be passed in as an argument?
    632             String cd_dir = "exported_collections";
    633             for(int i=0; i<args.length-1; i++) {
    634             if(args[i] == "-cdname") {
    635                 //Remove all spaces
    636                 String cdName = args[i+1];
    637                 Pattern pattern = Pattern.compile("\\s");
    638                 Matcher matcher = pattern.matcher(cdName);
    639                 cd_dir = "exported_" + matcher.replaceAll("");
    640             }
    641             }
    642             //DebugStream.println("cd_dir is: " + cd_dir);
    643 
    644             String tmp_dir = Utility.TMP_DIR;
    645             String user_tmp_dir = "/tmp";
    646 
    647             //String username = System.getProperty("user.name");
    648             //if ((username != null) && (username != "")) {
    649             // user_cd_dir = username + File.separator + cd_dir;
    650             //user_tmp_dir = user_tmp_dir + File.separator + username;
    651             //}
    652 
    653             String full_local_cd_dir = tmp_dir + cd_dir; //Need to tell user this!
    654 
    655             Utility.delete(full_local_cd_dir); // remove current cd-rom dir, if it exists
    656             RemoteGreenstoneServer.download_url_zip(user_tmp_dir,cd_dir,this,"","");
    657 
    658             ZipTools.unzip(Configuration.gsdl_path, user_tmp_dir.substring(1));
    659 
    660             if (progress!=null) {
    661             System.err.println("Asking progress bar to be empty string");
    662             progress.messageOnProgressBar("");
    663             }
    664            
    665             //The string needs to start with exportcol.pl> otherwise it won't be displayed in the final dialog
    666             String message = "exportcol.pl>\nThese files have been copied from the server to " + full_local_cd_dir + " and are ready to written to CD-ROM";
    667             fireMessage(type, message, status, bos); //Hopefully this works
    668             System.err.println("Finished download of /tmp ...");
    669         }
    670        
     632            if (progress!=null) {
     633            progress.messageOnProgressBar("");
     634            }
     635        }
    671636        }
    672637    }
Note: See TracChangeset for help on using the changeset viewer.