title: PayPal REST API java sdk - custom config file
body: <p>Good afternoon all!</p>
  
  <p>I use PayPal REST API java sdk and I want to have different configurations for different environments of my application. Here is how I'm trying to do so:</p>
  
  <pre><code>private static boolean IS_PRODUCTION = false;
  
  private static String PAYPAL_ACCESS_TOKEN;
  
  private static void initPayPal() {
      InputStream is = null;
      try {
          is = ApplicationConfig.class.getResourceAsStream(
                  IS_PRODUCTION? "/my_paypal_sdk_config.properties" : "/my_paypal_sdk_config_test.properties");
          PayPalResource.initConfig(is);
          String clientID = ConfigManager.getInstance().getConfigurationMap().get("clientID");
          String clientSecret = ConfigManager.getInstance().getConfigurationMap().get("clientSecret");
          PAYPAL_ACCESS_TOKEN = new OAuthTokenCredential(clientID, clientSecret).getAccessToken();
      } catch (Exception e) {
          throw new RuntimeException(e);
      } finally {
          IOUtils.closeQuietly(is);
      }
  }
  </code></pre>
  
  <p>and while trying to get the clientID I have</p>
  
  <pre><code>java.io.IOException: Resource 'sdk_config.properties' could not be found
  </code></pre>
  
  <p>Strange behavior - I thought I've just configured the sdk to use my own properties file.</p>
  
  <p>Please advice how could I set up those settings properly!</p>