Ignore:
Timestamp:
2004-07-16T13:53:15+12:00 (20 years ago)
Author:
davidb
Message:

General changes made to support GLI as an applet.

File:
1 edited

Legend:

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

    r7601 r7740  
    4040import java.awt.event.*;
    4141import java.io.*;
     42import java.net.*;
    4243import javax.swing.*;
    4344import javax.swing.event.*;
     
    315316        }
    316317
     318        if (Gatherer.isGsdlRemote) {
     319               
     320        String launch_cgi  = Gatherer.cgiBase + "launch?cmd=deldir";
     321
     322        String col_name = collection.getShortName();
     323        String dir = ".";
     324
     325        try {
     326
     327            String col_name_encoded = URLEncoder.encode(col_name,"UTF-8");
     328            String dir_encoded = URLEncoder.encode(dir,"UTF-8");
     329
     330            launch_cgi += "&c=" + col_name_encoded;
     331            launch_cgi += "&dir=" + dir_encoded;
     332       
     333            URL launch_url = new URL(launch_cgi);
     334            URLConnection launch_connection = launch_url.openConnection();
     335            InputStream stdis = launch_connection.getInputStream();
     336            InputStreamReader stdisr = new InputStreamReader(stdis, "UTF-8"  );
     337           
     338            BufferedReader stdbr = new BufferedReader(stdisr);
     339           
     340            while(true) {
     341            String line = stdbr.readLine();
     342            // ignore output of running lauch command
     343           
     344            if (line == null) { break; }
     345            }       
     346           
     347            stdbr.close();
     348        }
     349        // Exception
     350        catch (Exception exception) {
     351            Gatherer.println("Exception in GShell.runRemove() - unexpected");
     352            Gatherer.printStackTrace(exception);
     353        }
     354        }
     355
    317356        File delete_me;
    318357        if (Gatherer.GS3) {
     
    321360        delete_me = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path, collection.getShortName()));
    322361        }
    323         if(Utility.delete(delete_me)) {
     362        if (Utility.delete(delete_me)) {
    324363        if (Gatherer.c_man.getCollection() != null && collection.getShortName().equals(Gatherer.c_man.getCollection().getName())) {
    325364            current_coll_deleted = true;
Note: See TracChangeset for help on using the changeset viewer.