Changeset 30933 for other-projects
- Timestamp:
- 2016-10-26T10:24:53+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/solr-extracted-features/trunk/src/main/java/org/hathitrust/PagedJSON.java
r30932 r30933 48 48 49 49 if (fileIn.startsWith("hdfs://")) { 50 URI uri = URI.create (fileIn);51 Configuration conf = new Configuration();52 FileSystem file = FileSystem.get(uri, conf);53 FSDataInputStream fin = file.open(new Path(uri));54 55 bis = new BufferedInputStream(fin);50 URI uri = URI.create (fileIn); 51 Configuration conf = new Configuration(); 52 FileSystem file = FileSystem.get(uri, conf); 53 FSDataInputStream fin = file.open(new Path(uri)); 54 55 bis = new BufferedInputStream(fin); 56 56 } 57 57 else { 58 FileInputStream fin = new FileInputStream(fileIn); 59 bis = new BufferedInputStream(fin); 58 // Trim 'file://' off the front 59 60 String local_file_in = fileIn; 61 if (local_file_in.startsWith("file://")) { 62 local_file_in = fileIn.substring("file://".length()); 63 } 64 FileInputStream fin = new FileInputStream(local_file_in); 65 bis = new BufferedInputStream(fin); 60 66 } 61 67 62 68 return bis; 63 69
Note:
See TracChangeset
for help on using the changeset viewer.