Changeset 9942
- Timestamp:
- 2005-05-24T16:39:35+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/GathererApplet.java
r9896 r9942 144 144 145 145 Utility.METADATA_DIR = Utility.BASE_DIR + "metadata" + File.separator; 146 Utility.TMP_DIR = Utility.BASE_DIR + "tmp" + File.separator; 146 147 147 148 Configuration.TEMPLATE_CONFIG_XML = "xml/configRemote.xml"; … … 293 294 294 295 dl_dbis.close(); 296 dl_bis.close(); 297 dl_is.close(); 298 295 299 zip_bfos.close(); 300 zip_fos.close(); 296 301 297 302 } … … 399 404 dos.flush(); 400 405 dos.close(); 401 402 406 407 // delete zip file 408 boolean file_deleted = file.delete(); 409 if (file_deleted) { 410 System.err.println("Zip file " + file.toString() + " deleted"); 411 } 412 else { 413 System.err.println("Zip file " + file.toString() + " NOT deleted"); 414 } 403 415 } 404 416 catch (MalformedURLException ex) { -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r9894 r9942 881 881 882 882 String zip_fname = col_dir + col_name + ".zip"; 883 int zip_mode = ZipFile.OPEN_READ | ZipFile.OPEN_DELETE; 883 // int zip_mode = ZipFile.OPEN_READ | ZipFile.OPEN_DELETE; 884 int zip_mode = ZipFile.OPEN_READ; 884 885 885 886 try { 886 ZipFile zipfile = new ZipFile(new File(zip_fname), zip_mode); 887 File cfile = new File(zip_fname); 888 ZipFile zipfile = new ZipFile(cfile, zip_mode); 887 889 888 890 Enumeration e = zipfile.entries(); … … 890 892 ZipEntry zipentry = (ZipEntry) e.nextElement(); 891 893 String zentryname = col_dir + zipentry.getName(); 892 File file = new File(zentryname);894 File zfile = new File(zentryname); 893 895 DebugStream.println(" Unzipping: " + zentryname); 894 896 895 897 if (zipentry.isDirectory()) { 896 898 // Create named directory, if it doesn't already exist 897 if (! file.exists() && !file.mkdirs()) {898 System.err.println("Error: unable to create directory " + file);899 if (!zfile.exists() && !zfile.mkdirs()) { 900 System.err.println("Error: unable to create directory " + zfile); 899 901 } 900 902 } … … 903 905 904 906 //Make sure it's parent directory exists. 905 File dir = new File( file.getParent());907 File dir = new File(zfile.getParent()); 906 908 dir.mkdirs(); 907 909 … … 922 924 923 925 dbzis.close(); 926 bzis.close(); 927 zis.close(); 928 924 929 bfzos.close(); 925 } 926 } 930 fzos.close(); 931 } 932 } 933 934 zipfile.close(); 935 936 // delete zip file 937 boolean file_deleted = cfile.delete(); 938 if (file_deleted) { 939 System.err.println("Zip file " + cfile.toString() + " deleted"); 940 } 941 else { 942 System.err.println("Zip file " + cfile.toString() + " NOT deleted"); 943 } 944 945 927 946 } 928 947 catch (ZipException error) {
Note:
See TracChangeset
for help on using the changeset viewer.