Java ZipFile code does not cope with entries with lots of consecutive '.' - causes...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 18 Sep 2007 10:20:25 +0000 (10:20 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 18 Sep 2007 10:20:25 +0000 (10:20 +0000)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@472 be28352e-c001-0410-b1a7-c7978e42abec

src/uk/ac/vamsas/objects/utils/AppDataReference.java

index b1cf4f2..db06fa6 100644 (file)
@@ -146,13 +146,13 @@ public class AppDataReference {
    * @param entry base application reference to make unique 
    */
   public static String uniqueAppDataReference(VamsasDocument dest,String base) {
-    String urn = base.replace('/','.').replace('\\','.').replace(':', '_');
+    String urn = base.replace('/','_').replace('\\','_').replace(':', '_');
     int v = 1;
     for (int i=0, j=dest.getApplicationDataCount(); i<j; i++) {
       ApplicationData o = dest.getApplicationData()[i];
       // ensure new urn is really unique
       while (o.getDataReference()!=null && o.getDataReference().equals(urn)) {
-        urn = base+"."+v++;      
+        urn = base+"_"+v++;      
       } 
     }
     return urn;