Changeset 4649
- Timestamp:
- 15/12/08 16:47:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery/branches/ws-Discovery2-upgrade/src/ndg/common/discovery/Utilities.java
r4631 r4649 71 71 } 72 72 73 74 /** 75 * Returns the original format deduced from the original document filename as held in the postgres db 76 * (Needed for new system of matching sql xml recs to filename) 77 * 78 * @param filename - original document filename 79 * @return string representing the orignal format 80 */ 81 public static String getOriginalFormatFromFilename(String filename) { 82 83 String originalFormat = ""; 84 85 // i.e. dassh.ac.uk__MDIP__MRMLN001000000EB.xml or badc.nerc.ac.uk__DIF__badc.nerc.ac.uk-DIF-dataent_12282343659427027.xml 86 87 //get index of first "__" 88 Integer firstIndex = filename.indexOf("__"); 89 Integer secondIndex = filename.indexOf("__", firstIndex + 2); 90 //logger.info("firstindex = " + firstIndex.toString() + " second Index = " + secondIndex.toString()); 91 92 //extract the format 93 originalFormat = filename.substring(firstIndex + 2, secondIndex); 94 95 return originalFormat; 96 } 97 73 98 /** 74 99 * Returns the closing element to be used with the regex depending on requestedFormat … … 94 119 } 95 120 96 return closingElement;121 return closingElement; 97 122 } 98 123
Note: See TracChangeset
for help on using the changeset viewer.