Changeset 10373


Ignore:
Timestamp:
2005-08-01T14:20:56+12:00 (19 years ago)
Author:
mdewsnip
Message:

Now will create any intermediate directories as required.

File:
1 edited

Legend:

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

    r10252 r10373  
    9696            String file_name = entry.getName();
    9797            String full_file_name = destination_directory_path + file_name;
     98            File directory = (new File(full_file_name)).getParentFile();
    9899            // System.err.println("Full file name: " + full_file_name);
     100            if (!directory.exists() && !directory.mkdirs()) {
     101            System.err.println("Error: Could not create directory " + directory + "!");
     102            }
     103
    99104            FileOutputStream fos = new FileOutputStream(full_file_name);
    100105            BufferedOutputStream bos = new BufferedOutputStream(fos);
Note: See TracChangeset for help on using the changeset viewer.