Changeset 9884 for trunk/gli


Ignore:
Timestamp:
2005-05-16T15:21:42+12:00 (19 years ago)
Author:
davidb
Message:

Extra functionality to support export to cd-rom image added back in.
Includes making sure a tmp directory exists top-level GSDLHOME and
the a leading slash on an upload or download directory means it is
relative to GSDLHOME rather than a collection.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

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

    r9883 r9884  
    167167        }
    168168
    169     /*
     169   
    170170        File tmp_dir = new File(Utility.TMP_DIR);
    171171        if (!tmp_dir.exists()) {
    172172            tmp_dir.mkdir();
    173173        }
    174     */
     174
    175175
    176176    File metadata_directory = new File(Utility.METADATA_DIR);
     
    265265           
    266266        // set up output stream for zip download
    267         String collect_directory_path = Gatherer.getCollectDirectoryPath();
    268         String zip_fname = collect_directory_path + col_name + ".zip";
     267        String col_dir;
     268        if (col_name.startsWith("/")) {
     269        col_dir = Configuration.gsdl_path;
     270        }
     271        else {
     272        col_dir = Gatherer.getCollectDirectoryPath();
     273        }
     274
     275        String zip_fname = col_dir + col_name + ".zip";
    269276        FileOutputStream zip_fos = new FileOutputStream(zip_fname);
    270277        BufferedOutputStream zip_bfos = new BufferedOutputStream(zip_fos);
     
    295302    final int maxBufferSize = 1024;
    296303
    297     String collect_directory_path = Gatherer.getCollectDirectoryPath();
    298     String zip_fname = collect_directory_path + col_name + ".zip";
     304    String col_dir;
     305    if (col_name.startsWith("/")) {
     306        col_dir = Configuration.gsdl_path;
     307    }
     308    else {
     309        col_dir = Gatherer.getCollectDirectoryPath();
     310    }
     311
     312    String zip_fname = col_dir + col_name + ".zip";
    299313    String upload_cgi = Gatherer.cgiBase + "upload";
    300314
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r9883 r9884  
    9595    static final public String GLI_ARCHIVE = "GLI.jar";
    9696    static final public String GLI_EXTENSION = ".col";
     97
     98    static public String TMP_DIR  = BASE_DIR + "tmp" + File.separator;
     99
    97100    /** Definition of an important directory name, in this case the images directory for the collection. */
    98101    static final public String IMAGES_DIR = "images" + File.separator;
Note: See TracChangeset for help on using the changeset viewer.