Changeset 31336
- Timestamp:
- 2017-01-23T20:46:54+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java
r31335 r31336 72 72 73 73 // 3. Finally add in the (safely transformed) id: 74 // append directory that is 'id' 75 // further append 'id'.json.bz 76 77 78 String id_safe = id.replaceAll("\\.", ",").replaceAll(":", "+").replaceAll("/", "="); 79 80 int id_dot_pos = id_safe.indexOf("."); 81 String id_prefix = id_safe.substring(0,id_dot_pos); 82 String id_tail = id_safe.substring(id_dot_pos+1); 83 84 String [] pairs = id_tail.split("(?<=\\G..)"); 74 // append directory that is prefix-removed id (transformed to be safe) 75 // further append 'id-safe'.json.bz 76 77 int id_dot_pos = id.indexOf("."); 78 String id_prefix = id.substring(0,id_dot_pos); 79 String id_tail = id.substring(id_dot_pos+1); 80 String id_tail_safe = id_tail.replaceAll("\\.", ",").replaceAll(":", "+").replaceAll("/", "="); 81 82 String [] pairs = id_tail_safe.split("(?<=\\G..)"); 85 83 String joined_pairs = String.join("/", pairs); 86 84 85 String id_safe = id_prefix + "." + id_tail_safe; 87 86 String main_dir = id_prefix + "/pairtree_root/" + joined_pairs; 88 String filename = main_dir + "/" + id_ safe + "/" + id_safe + file_ext;87 String filename = main_dir + "/" + id_tail_safe + "/" + id_safe + file_ext; 89 88 90 89 return filename;
Note:
See TracChangeset
for help on using the changeset viewer.