Changeset 31024
- Timestamp:
- 2016-11-02T11:37:07+13:00 (7 years ago)
- Location:
- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/ProcessForSolrIngest.java
r31013 r31024 1 1 package org.hathitrust.extractedfeatures; 2 2 3 import java.io.BufferedInputStream; 4 import java.io.FileInputStream; 5 import java.io.FileNotFoundException; 6 import java.io.IOException; 3 7 import java.io.Serializable; 4 8 import org.apache.commons.cli.*; … … 178 182 options.addOption(verbosity_opt); 179 183 184 Option properties_opt = new Option("p", "properties", false, 185 "Read in the specified Java properties file."); 186 properties_opt.setRequired(false); 187 options.addOption(properties_opt); 188 180 189 Option output_dir_opt = new Option("o", "output-dir", true, 181 190 "If specified, save BZipped Solr JSON files to this directory"); … … 213 222 int verbosity = Integer.parseInt(verbosity_str); 214 223 224 String property_filename = cmd.getOptionValue("properties",null); 225 215 226 String output_dir = cmd.getOptionValue("output-dir",null); 216 227 String solr_url = cmd.getOptionValue("solr-url",null); … … 222 233 print_usage(formatter,options); 223 234 System.exit(1); 235 } 236 237 if (property_filename != null) { 238 try { 239 FileInputStream fis = new FileInputStream(property_filename); 240 BufferedInputStream bis = new BufferedInputStream(fis); 241 242 System.getProperties().load(bis); 243 } 244 catch (FileNotFoundException e) { 245 // TODO Auto-generated catch block 246 e.printStackTrace(); 247 System.err.println("File not found: '" + property_filename + "'. Skipping property file read"); 248 } 249 catch (IOException e) { 250 System.err.println("IO Exception for: '" + property_filename + "'. Malformed syntax? Skipping property file read"); 251 } 224 252 } 225 253
Note:
See TracChangeset
for help on using the changeset viewer.