public static GitHubBuilder fromPropertyFile(String propertyFileName) throws IOException { Properties props = new Properties(); FileInputStream in = null; try { in = new FileInputStream(propertyFileName); props.load(in); } finally { IOUtils.closeQuietly(in); } return fromProperties(props); }
public static GitHubBuilder fromPropertyFile(String propertyFileName) throws IOException { Properties props = new Properties(); FileInputStream in = null; try { in = new FileInputStream(propertyFileName); props.load(in); } finally { IOUtils.closeQuietly(in); } return fromProperties(props); }
public static GitHubBuilder fromPropertyFile(String propertyFileName) throws IOException { Properties props = new Properties(); FileInputStream in = null; try { in = new FileInputStream(propertyFileName); props.load(in); } finally { IOUtils.closeQuietly(in); } return fromProperties(props); }
/** * Creates {@link GitHubBuilder} by picking up coordinates from environment variables. * * <p> * The following environment variables are recognized: * * <ul> * <li>GITHUB_LOGIN: username like 'kohsuke' * <li>GITHUB_PASSWORD: raw password * <li>GITHUB_OAUTH: OAuth token to login * <li>GITHUB_ENDPOINT: URL of the API endpoint * </ul> * * <p> * See class javadoc for the relationship between these coordinates. * * <p> * For backward compatibility, the following environment variables are recognized but discouraged: * login, password, oauth */ public static GitHubBuilder fromEnvironment() throws IOException { Properties props = new Properties(); for (Entry<String, String> e : System.getenv().entrySet()) { String name = e.getKey().toLowerCase(Locale.ENGLISH); if (name.startsWith("github_")) name=name.substring(7); props.put(name,e.getValue()); } return fromProperties(props); }
/** * Creates {@link GitHubBuilder} by picking up coordinates from environment variables. * * <p> * The following environment variables are recognized: * * <ul> * <li>GITHUB_LOGIN: username like 'kohsuke' * <li>GITHUB_PASSWORD: raw password * <li>GITHUB_OAUTH: OAuth token to login * <li>GITHUB_ENDPOINT: URL of the API endpoint * </ul> * * <p> * See class javadoc for the relationship between these coordinates. * * <p> * For backward compatibility, the following environment variables are recognized but discouraged: * login, password, oauth */ public static GitHubBuilder fromEnvironment() throws IOException { Properties props = new Properties(); for (Entry<String, String> e : System.getenv().entrySet()) { String name = e.getKey().toLowerCase(Locale.ENGLISH); if (name.startsWith("github_")) name=name.substring(7); props.put(name,e.getValue()); } return fromProperties(props); }
/** * Creates {@link GitHubBuilder} by picking up coordinates from environment variables. * * <p> * The following environment variables are recognized: * * <ul> * <li>GITHUB_LOGIN: username like 'kohsuke' * <li>GITHUB_PASSWORD: raw password * <li>GITHUB_OAUTH: OAuth token to login * <li>GITHUB_ENDPOINT: URL of the API endpoint * </ul> * * <p> * See class javadoc for the relationship between these coordinates. * * <p> * For backward compatibility, the following environment variables are recognized but discouraged: * login, password, oauth */ public static GitHubBuilder fromEnvironment() throws IOException { Properties props = new Properties(); for (Entry<String, String> e : System.getenv().entrySet()) { String name = e.getKey().toLowerCase(Locale.ENGLISH); if (name.startsWith("github_")) name=name.substring(7); props.put(name,e.getValue()); } return fromProperties(props); }
/** * @deprecated * Use {@link #fromEnvironment()} to pick up standard set of environment variables, so that * different clients of this library will all recognize one consistent set of coordinates. */ public static GitHubBuilder fromEnvironment(String loginVariableName, String passwordVariableName, String oauthVariableName, String endpointVariableName) throws IOException { Properties env = new Properties(); loadIfSet(loginVariableName,env,"login"); loadIfSet(passwordVariableName,env,"password"); loadIfSet(oauthVariableName,env,"oauth"); loadIfSet(endpointVariableName,env,"endpoint"); return fromProperties(env); }
/** * @deprecated * Use {@link #fromEnvironment()} to pick up standard set of environment variables, so that * different clients of this library will all recognize one consistent set of coordinates. */ public static GitHubBuilder fromEnvironment(String loginVariableName, String passwordVariableName, String oauthVariableName, String endpointVariableName) throws IOException { Properties env = new Properties(); loadIfSet(loginVariableName,env,"login"); loadIfSet(passwordVariableName,env,"password"); loadIfSet(oauthVariableName,env,"oauth"); loadIfSet(endpointVariableName,env,"endpoint"); return fromProperties(env); }
/** * @deprecated * Use {@link #fromEnvironment()} to pick up standard set of environment variables, so that * different clients of this library will all recognize one consistent set of coordinates. */ public static GitHubBuilder fromEnvironment(String loginVariableName, String passwordVariableName, String oauthVariableName, String endpointVariableName) throws IOException { Properties env = new Properties(); loadIfSet(loginVariableName,env,"login"); loadIfSet(passwordVariableName,env,"password"); loadIfSet(oauthVariableName,env,"oauth"); loadIfSet(endpointVariableName,env,"endpoint"); return fromProperties(env); }