Ignore:
Timestamp:
2009-04-23T13:55:26+12:00 (15 years ago)
Author:
ak19
Message:

Correction for allowing the metadata directories of collections nested in collectiongroups to get zipped up. Ziptools now handles empty directories with a dummy file.

File:
1 edited

Legend:

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

    r13406 r19221  
    7676            addFileToZip(zos, base_directory_path, relative_file_path + File.separator + child_files[i].getName(), zip_filter);
    7777        }
     78
     79        // empty directory. Java zips don't allow empty dirs, so need to put some dummy file in there
     80        if(child_files.length == 0) {
     81            String rel_path = relative_file_path.replace('\\', '/') + File.separator + "empty";
     82            System.err.println("Zipping empty dir requires dummy file: " + rel_path);
     83            zos.putNextEntry(new ZipEntry(rel_path));
     84        }
    7885        }
    7986
Note: See TracChangeset for help on using the changeset viewer.