Changeset 32101 for other-projects/hathitrust/wcsa
- Timestamp:
- 2018-01-12T18:16:31+13:00 (6 years ago)
- Location:
- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/ClusterFileIO.java
r31310 r32101 5 5 import java.io.BufferedReader; 6 6 import java.io.BufferedWriter; 7 import java.io.FileInputStream; 7 8 import java.io.FileOutputStream; 8 9 import java.io.IOException; … … 135 136 } 136 137 else { 138 139 140 // Trim 'file://' off the front 137 141 /* 138 // Trim 'file://' off the front139 142 String local_file_in = fileIn; 140 143 if (local_file_in.startsWith("file://")) { 141 144 local_file_in = fileIn.substring("file://".length()); 142 145 } 146 else if (local_file_in.startsWith("file:/")) { 147 local_file_in = fileIn.substring("file:/".length()); 148 } 143 149 FileInputStream fin = new FileInputStream(local_file_in); 144 150 bis = new BufferedInputStream(fin); 145 151 */ 152 153 146 154 URI uri = URI.create (fileIn); 147 155 Path path = new Path(uri); 148 156 149 157 FSDataInputStream fin = fs.open(path); 150 151 158 bis = new BufferedInputStream(fin); 159 160 152 161 } 153 162 -
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/UniversalPOSLangMap.java
r31509 r32101 38 38 e.printStackTrace(); 39 39 } 40 try (Stream<Path> stream_paths = Files.walk(Paths.get(langmap_directory_uri))) { 40 41 Path langmap_directory_path = null; 42 try { 43 // Spark/Hadoop friendly 44 langmap_directory_path = Paths.get(langmap_directory_uri); 45 } 46 catch (Exception e) { 47 // Relative local file-system friendly 48 langmap_directory_path = Paths.get(langmap_directory_uri.getRawPath()); 49 } 50 51 52 try (Stream<Path> stream_paths = Files.walk(langmap_directory_path)) { 41 53 langmap_paths = stream_paths 42 54 .filter(Files::isRegularFile)
Note:
See TracChangeset
for help on using the changeset viewer.