Revision: 17252
          http://sourceforge.net/p/gate/code/17252
Author:   valyt
Date:     2014-01-28 17:13:53 +0000 (Tue, 28 Jan 2014)
Log Message:
-----------
Not deleting the file you've just created can be seen as an advantage.

Modified Paths:
--------------
    
mimir/branches/5.0/mimir-core/src/gate/mimir/index/mg4j/zipcollection/DocumentCollection.java

Modified: 
mimir/branches/5.0/mimir-core/src/gate/mimir/index/mg4j/zipcollection/DocumentCollection.java
===================================================================
--- 
mimir/branches/5.0/mimir-core/src/gate/mimir/index/mg4j/zipcollection/DocumentCollection.java
       2014-01-28 16:57:52 UTC (rev 17251)
+++ 
mimir/branches/5.0/mimir-core/src/gate/mimir/index/mg4j/zipcollection/DocumentCollection.java
       2014-01-28 17:13:53 UTC (rev 17252)
@@ -572,7 +572,9 @@
             // create the new file
             String newFileName = "temp-" + 
                 CollectionFile.MIMIR_COLLECTION_BASENAME + 
-                intervalStart + "-" + intervalEnd + 
+                colFilesArr[intervalStart].collectionFileNumber + 
+                "-" + 
+                colFilesArr[intervalEnd].collectionFileNumber + 
                 CollectionFile.MIMIR_COLLECTION_EXTENSION;
             File newZipFile = new File(indexDirectory, newFileName);
             ZipOutputStream  zos = new ZipOutputStream(new 
BufferedOutputStream(
@@ -607,12 +609,13 @@
                   return;
                 }
               }
-              // replace the old files with the new one
+              // build name for new collection file
               File newCollectionFile = new File(indexDirectory, 
                   CollectionFile.getCollectionFileName(
-                      Integer.toString(intervalStart) + "-" + 
-                      Integer.toString(intervalEnd)));
-              newZipFile.renameTo(newCollectionFile);
+                      
Integer.toString(colFilesArr[intervalStart].collectionFileNumber) + 
+                      "-" + 
+                      
Integer.toString(colFilesArr[intervalEnd].collectionFileNumber)));
+              // delete the old files
               for(int j = intervalStart; j <= intervalEnd; j++) {
                 CollectionFile oldColFile = 
collectionFiles.remove(intervalStart);
                 if(!oldColFile.file.delete()) {
@@ -622,6 +625,9 @@
                       "Document collection now inconsistent.");
                 }
               }
+              // rename temp file to new name
+              newZipFile.renameTo(newCollectionFile);
+              // add new collection file
               collectionFiles.add(intervalStart, new 
CollectionFile(newCollectionFile));
             }
           } else {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to