Changeset 31336


Ignore:
Timestamp:
2017-01-23T20:46:54+13:00 (7 years ago)
Author:
davidb
Message:

Changes in response to testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java

    r31335 r31336  
    7272       
    7373        // 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..)");
    8583        String joined_pairs = String.join("/", pairs);
    8684
     85        String id_safe = id_prefix + "." + id_tail_safe;
    8786        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;
    8988       
    9089        return filename;
Note: See TracChangeset for help on using the changeset viewer.