Changeset 3458
- Timestamp:
- 2002-10-11T13:44:41+13:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gdbm/GDBMWrapper.java
r3289 r3458 3 3 import org.greenstone.gsdl3.util.OID; 4 4 import au.com.pharos.gdbm.GdbmFile; 5 import au.com.pharos.packing. StringPacking;5 import au.com.pharos.packing.*; 6 6 import au.com.pharos.gdbm.GdbmException; 7 7 … … 126 126 } 127 127 128 // convenience methods 128 // greenstone convenience methods - should these go into a separate class? 129 129 130 /** converts a greenstone OID to internal docnum */ 130 131 public long oid2Docnum(String OID) { … … 139 140 return oid; 140 141 } 142 143 /** translates oids containing .pr, .fc, .lc, .ns, .ps into proper oids 144 * a suffix is expected to be present so test before using */ 145 public String translateOID(String oid) { 146 147 int p = oid.lastIndexOf('.'); 148 if (p != oid.length()-3) { 149 System.out.println("translateoid error: '.' is not the third to last char!!"); 150 return oid; 151 } 152 153 String top = oid.substring(0, p); 154 String suff = oid.substring(p+1); 155 if (suff.equals("pr")) { 156 return OID.getParent(top); 157 } else if (suff.equals("fc")) { 158 } else if (suff.equals("lc")) { 159 } else if (suff.equals("ns")) { 160 } else if (suff.equals("ps")) { 161 } 162 return oid; 163 } 141 164 }
Note:
See TracChangeset
for help on using the changeset viewer.