* @param entry base application reference to make unique
*/
public static String uniqueAppDataReference(VamsasDocument dest,String base) {
- String urn = new String(base);
-
+ 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
- int v = 1;
- // TODO: while (o.getUrn().equals(urn)) {
- urn = base+"/"+v++;
- //}
+ while (o.getDataReference()!=null && o.getDataReference().equals(urn)) {
+ urn = base+"."+v++;
+ }
}
return urn;
}