public ImportServlet() { super(); this.geppaequoConfig = CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); }
private TitleAndModule(String title, final String module) { if (title == null || title.length() == 0) { this.theTitle = CONFIG_REGISTRY.getConfig(GeppaequoConfig.class).getTitle(); } else { this.theTitle = title; } this.theModule = module; }
private JsonObject getAccessToken(CloseableHttpClient httpclient, String code) throws Exception { JsonObject accessTokenEntityAsJsonObject; URI uriPost2GetAccessToken = URI.create("https://github.com/login/oauth/access_token"); if (this.githubKey == null) { this.githubKey = codec.decrypt(CONFIG_REGISTRY.getConfig(TuhaoConfig.class).getEncryptedGithubKey().toCharArray()); } HttpPost httpPost2GetAccessToken = new HttpPost(uriPost2GetAccessToken); httpPost2GetAccessToken.addHeader("Accept", MediaType.APPLICATION_JSON); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("client_id", this.githubId)); nameValuePairs.add(new BasicNameValuePair("client_secret", this.githubKey)); nameValuePairs.add(new BasicNameValuePair("code", code)); httpPost2GetAccessToken.setEntity(new UrlEncodedFormEntity(nameValuePairs)); try (CloseableHttpResponse accessTokenResponse = httpclient.execute(httpPost2GetAccessToken)) { HttpEntity accessTokenEntity = accessTokenResponse.getEntity(); accessTokenEntityAsJsonObject = mapper.readValue(EntityUtils.toString(accessTokenEntity), JsonObject.class); EntityUtils.consume(accessTokenEntity); } return accessTokenEntityAsJsonObject; }
public Resource() { super(); this.laxRedirectStrategy = new LaxRedirectStrategy(); this.mapper = new ObjectMapper(); this.mapper.registerModule(new JSR353Module()); this.githubId = CONFIG_REGISTRY.getConfig(TuhaoConfig.class).getGithubId(); }
@Override public void execute(JobExecutionContext context) throws JobExecutionException { log.info("starting Cleaner job"); try { BuildHubConfig config = CONFIG_REGISTRY.getConfig(BuildHubConfig.class); LAffreuxSingleton.getInstance().clean(config.getDays()); } catch (IOException e) { throw new JobExecutionException(e); } finally { log.info("stopping Cleaner job"); } }
private static KeyPair getKeyPair() { GeppaequoConfig config = CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); KeyPair keyPair = null; try {
private boolean hasPermission(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse) throws IOException { final GeppaequoConfig geppaequoConfig = CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); try {
public Booter() throws IOException { super(); this.tempDirectory = new TempDirectory("local-repo"); this.geppaequoConfig = CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); if (this.geppaequoConfig.getProxyHost() != null && !this.geppaequoConfig.getProxyHost().isEmpty()) { this.proxy = new Proxy(null, this.geppaequoConfig.getProxyHost(), this.geppaequoConfig.getProxyPort()); } else { this.proxy = null; } }
public List<RemoteRepository> newRepositories(RepositorySystem system, RepositorySystemSession session) { List<RemoteRepository> ret = new ArrayList<>(); List<QuintessenceConfig.Repo> repositories = CONFIG_REGISTRY.getConfig(QuintessenceConfig.class).getRepositoryObjects(); for (QuintessenceConfig.Repo repository : repositories) { Builder builder = new RemoteRepository .Builder(repository.getName(), "default", repository.getUri().toString()) .setPolicy(new RepositoryPolicy(true, UPDATE_POLICY_ALWAYS, CHECKSUM_POLICY_WARN)); if (this.proxy != null && !this.geppaequoConfig.matchNonProxyHosts(repository.getUri().getHost())) { ret.add(builder.setProxy(this.proxy).build()); } else { ret.add(builder.build()); } } return ret; }
@Override public void contextInitialized(ServletContextEvent arg0) { this.mapper = new ObjectMapper(); try { this.googleCloudMessagingAPIKey = codec.decrypt(CONFIG_REGISTRY.getConfig(DagrConfig.class).getEncryptedGoogleCloudMessagingAPIKey().toCharArray()); } catch (Exception e) { e.printStackTrace(); } Bus<Node> theBus = dags.getBusFromTravis("aequologica", null); if (theBus != null) { subscription = theBus.toObservable() .filter( event -> event.getType().equals(BusEvent.Type.CLEAN_OK) || event.getType().equals(BusEvent.Type.CLEAN_ERROR) || event.getType().equals(BusEvent.Type.CLEAN_ABORTED)) .map( event -> event.get()) .subscribe( node -> sendNotification(node)); } log.debug("[gcm] subbscribed !"); } @Override
GeppaequoConfig config = ConfigRegistry.CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); String proxyIfNeeded = config.getProxyIfNeeded(this.uri.getHost()); if (proxyIfNeeded != null) {
GeppaequoConfig config = ConfigRegistry.CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); String proxyIfNeeded = config.getProxyIfNeeded(this.uri.getHost()); if (proxyIfNeeded != null) {
); final GeppaequoConfig geppaequoConfig = ConfigRegistry.CONFIG_REGISTRY.getConfig(GeppaequoConfig.class); final List<String> includes = geppaequoConfig.getLifebuoy().getIncludes(); final List<String> excludes = geppaequoConfig.getLifebuoy().getExcludes();