/** * Creates JSON Configuration object from the system config file * * @throws IOException if there was an error during creation */ public JsonSimpleConfig() throws IOException { super(JsonSimpleConfig.getSystemFile()); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
/** * <p> * Store the underlying system configuration on disk in the appropriate * location. * </p> * * <p> * Normal modifications to this objects JSON are not written to disk unless * they they are made via writableSystemConfig(). * </p> * * @return JsonObject : A reference to the system configuration JSON object */ public void storeSystemConfig() throws IOException { FileWriter writer = new FileWriter(JsonSimpleConfig.getSystemFile()); writer.write(systemConfig.toString(true)); writer.close(); }
/** * Creates JSON Configuration object from the provided config file * * @param jsonFile : The file containing JSON * @throws IOException if there was an error during creation */ public JsonSimpleConfig(File jsonFile) throws IOException { super(jsonFile); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
/** * IndexClient Constructor * * @throws IOException If initialisation fail */ public IndexClient() throws IOException { config = new JsonSimpleConfig(); configFile = JsonSimpleConfig.getSystemFile(); setSetting(); }
/** * Creates JSON Configuration object from the provided input stream * * @param jsonIn : The input stream to read * @throws IOException if there was an error during creation */ public JsonSimpleConfig(InputStream jsonIn) throws IOException { super(jsonIn); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
/** * Creates JSON Configuration object from the provided config string * * @param jsonString : The JSON in string form * @throws IOException if there was an error during creation */ public JsonSimpleConfig(String jsonString) throws IOException { super(jsonString); systemConfig = new JsonSimple(JsonSimpleConfig.getSystemFile()); loadIncludeDir(); }
@Override public Indexer getIndexer() { Indexer indexer = new SolrIndexer(); try { indexer.init(JsonSimpleConfig.getSystemFile()); } catch (Exception e) { } return indexer; }
@PostConstruct public void init() throws RolesException { try { setConfig(new JsonSimpleConfig(JsonSimpleConfig.getSystemFile())); } catch (RolesException e) { throw new RolesException(e); } catch (IOException ioe) { throw new RolesException(ioe); } }
subscriberList = new ArrayList<Subscriber>(); globalConfig = new JsonSimpleConfig(); File sysFile = JsonSimpleConfig.getSystemFile(); List<String> subscribers = config.getStringList("config", "subscribers");
DigitalObject object = StorageUtils.getDigitalObject(storage, oid); Transformer transformer = PluginManager.getTransformer("jsonVelocity"); transformer.init(JsonSimpleConfig.getSystemFile()); transformer.transform(object, "{}");
/** * Initialization method * * @param config Configuration to use * @throws IOException if the configuration file not found */ @Override public void init(JsonSimpleConfig config) throws Exception { name = config.getString(null, "config", "name"); QUEUE_ID = name; thread.setName(name); try { globalConfig = new JsonSimpleConfig(); indexer = PluginManager.getIndexer( globalConfig.getString("solr", "indexer", "type")); indexer.init(JsonSimpleConfig.getSystemFile()); storage = PluginManager.getStorage( globalConfig.getString("file-system", "storage", "type")); storage.init(JsonSimpleConfig.getSystemFile()); } catch (IOException ioe) { log.error("Failed to read configuration: {}", ioe.getMessage()); throw ioe; } catch (PluginException pe) { log.error("Failed to initialise plugin: {}", pe.getMessage()); throw pe; } }
if (configOid == null) { log.warn("No harvest config for '{}', using defaults..."); configFile = JsonSimpleConfig.getSystemFile(); } else { log.info("Using config from '{}'", configOid);
/** * Reset the transformer in preparation for a new object */ private void reset() throws TransformerException { // First time execution, prepare storage if (storage == null) { try { String storageType = config.getString(null, "storage", "type"); storage = PluginManager.getStorage(storageType); storage.init(JsonSimpleConfig.getSystemFile()); } catch (Exception ex) { throw new TransformerException(ex); } } }
File sysFile = JsonSimpleConfig.getSystemFile(); indexer = PluginManager.getIndexer( globalConfig.getString("solr", "indexer", "type"));
sysFile = JsonSimpleConfig.getSystemFile();
"storage", "type"); storage = PluginManager.getStorage(storageType); storage.init(JsonSimpleConfig.getSystemFile()); } catch (Exception ex) { throw new TransformerException(ex);
File sysFile = JsonSimpleConfig.getSystemFile(); indexer = PluginManager.getIndexer( globalConfig.getString("solr", "indexer", "type"));
File sysFile = JsonSimpleConfig.getSystemFile(); indexer = PluginManager.getIndexer( globalConfig.getString("solr", "indexer", "type"));
sysFile = JsonSimpleConfig.getSystemFile(); } catch (IOException ioe) { log.error("Failed to read configuration: {}", ioe.getMessage());
sysFile = JsonSimpleConfig.getSystemFile(); } catch (IOException ioe) { log.error("Failed to read configuration: {}", ioe.getMessage());