Ignore:
Timestamp:
2006-08-22T15:18:13+12:00 (18 years ago)
Author:
kjdon
Message:

tidied up a bit: style, command list generation, indentation

File:
1 edited

Legend:

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

    r12470 r12498  
    4949import org.greenstone.gatherer.Dictionary;
    5050import org.greenstone.gatherer.Gatherer;
     51import org.greenstone.gatherer.LocalGreenstone;
    5152import org.greenstone.gatherer.file.WorkspaceTree;
    5253import org.greenstone.gatherer.util.StaticStrings;
     
    227228    try {
    228229        if (Gatherer.isGsdlRemote) {
    229         String launch  = Gatherer.cgiBase + "launch";
    230         launch += "?cmd=downloadinfo.pl";
    231         launch += "&xml=&language="+lang;
    232         launch += "&plug=" + download_name;
    233        
     230        StringBuffer launch_str = new StringBuffer();
     231        launch_str.append(Gatherer.cgiBase);
     232        launch_str.append("launch");
     233        launch_str.append("?cmd=downloadinfo.pl&xml=&language=");
     234        launch_str.append(lang);
     235        launch_str.append("&plug=");
     236        launch_str.append(download_name);
     237
     238        String launch = launch_str.toString();     
    234239        System.err.println("*** launch = " + launch);
    235240       
     
    239244        }
    240245        else {
     246        ArrayList args_list = new ArrayList();
    241247        String args[] = null;
    242248        if(Utility.isWindows()) {
    243             args = new String[6];
    244249            if(Configuration.perl_path != null) {
    245             args[0] = Configuration.perl_path;
     250            args_list.add(Configuration.perl_path);
    246251            }
    247252            else {
    248             args[0] = "Perl.exe";
     253            args_list.add("Perl.exe");
    249254            }
    250             args[1] = Configuration.gsdl_path + "bin" + File.separator + "script" + File.separator + "downloadinfo.pl";
    251             args[2] = "-xml";
    252             args[3] = "-language";
    253             args[4] = lang;
    254             args[5] = download_name;
    255255        }
    256         else {
    257             args = new String[5];
    258             args[0] = "downloadinfo.pl";
    259             args[1] = "-xml";
    260             args[2] = "-language";
    261             args[3] = lang;
    262             args[4] = download_name;
    263         }
    264 
     256        args_list.add(LocalGreenstone.getBinScriptDirectoryPath()+"downloadinfo.pl");
     257        args_list.add("-xml");
     258        args_list.add("-language");
     259        args_list.add(lang);
     260        args_list.add(download_name);
     261       
    265262        // Create the process.
    266 
     263        args = (String []) args_list.toArray(new String[0]);
    267264        Runtime runtime = Runtime.getRuntime();
     265        DebugStream.println("Getting Download Info: "+args_list);
    268266        Process process = runtime.exec(args);
    269267       
     
    525523    public void actionPerformed(ActionEvent event) {
    526524       
    527         if(checkURL(true) && checkProxy() == true)
    528         {
    529              getter.newDownloadJob((Download)download_map.get(mode) ,mode,proxy_url);
    530         }
     525        if(checkURL(true) && checkProxy() == true) {
     526       
     527        getter.newDownloadJob((Download)download_map.get(mode) ,mode,proxy_url);
     528        }
    531529    }
    532530    }
     
    646644
    647645
    648         if(server_info != null)
    649         {
    650             server_info.dispose();
    651         }
     646        if(server_info != null) {
     647        server_info.dispose();
     648        }
    652649
    653650       
     
    655652        String str_url = "";
    656653
    657         if( arg_url!= null && arg_url.isAssigned())
    658         {       
    659             str_url = arg_url.getValue();
    660         }
     654        if( arg_url!= null && arg_url.isAssigned()) {
     655        str_url = arg_url.getValue();
     656        }
    661657
    662658           
    663659        server_info = new ServerInfoDialog(str_url ,proxy_url, mode,(Download)download_map.get(mode));
    664         server_info.setVisible(true);                     
     660       
    665661    }
    666662    }
Note: See TracChangeset for help on using the changeset viewer.