Esempio n. 1
0
  public static AlchemyAPI_JSON GetInstanceFromFile(String keyFilename)
      throws FileNotFoundException, IOException {
    AlchemyAPI_JSON api = new AlchemyAPI_JSON();
    api.LoadAPIKey(keyFilename);

    return api;
  }
Esempio n. 2
0
  public static AlchemyAPI_JSON GetInstanceFromProperties() {
    AlchemyAPI_JSON api = new AlchemyAPI_JSON();

    try {
      api.SetAPIKey(new PropertiesManager().getExtractorKey("AlchemyApi"));
    } catch (Exception e) {
      // If an exception occurs log the error
      logger.error("Exception Message: " + e.getMessage(), e);
      return null;
    }

    return api;
  }
Esempio n. 3
0
  public static AlchemyAPI_JSON GetInstanceFromString(String apiKey) {
    AlchemyAPI_JSON api = new AlchemyAPI_JSON();
    api.SetAPIKey(apiKey);

    return api;
  }