public SlackWrapper () { this.useAttachment = TeamCityProperties.getBooleanOrTrue("teamcity.notification.slack.useAttachment"); }
private static String getProxyParam(String param, String agentName) { String agentSuffix; String returnParam = null; if (StringUtils.isNotBlank(agentName)) { agentSuffix = "." + agentName; returnParam = TeamCityProperties.getProperty(param + agentSuffix); } if (StringUtils.isBlank(returnParam)) { returnParam = TeamCityProperties.getProperty(param); } return returnParam; }
@Override public int getUrlLifetimeSec() { return TeamCityProperties.getInteger(S3Constants.S3_URL_LIFETIME_SEC, S3Constants.DEFAULT_S3_URL_LIFETIME_SEC); }
final String singleLineMessage = StringUtil.replace(StringUtil.replace(result, ".\n", ". "), "\n", ". "); String logMessage; if (TeamCityProperties.getBooleanOrTrue(REST_INCLUDE_REQUEST_DETAILS_INTO_ERRORS)){ logMessage = singleLineMessage + " Request: " + WebUtil.getRequestDump(request) + "."; }else{ final String includeStacktrace = TeamCityProperties.getProperty(REST_INCLUDE_EXCEPTION_STACKTRACE_PROPERTY, "false"); if (e != null && !"false".equals(includeStacktrace)) { if ( "true".equals(request.getParameter(INCLUDE_STACKTRACE_REQUST_PARAMETER)) ||
final AtomicInteger errorNum = new AtomicInteger(); final int batchSize = TeamCityProperties.getInteger(S3Constants.S3_CLEANUP_BATCH_SIZE, 1000); final boolean useParallelStream = TeamCityProperties.getBooleanOrTrue(S3Constants.S3_CLEANUP_USE_PARALLEL); final List<List<String>> partitions = Lists.partition(toDelete, batchSize); final Stream<List<String>> listStream = partitions.size() > 1 && useParallelStream
@NotNull @Override public String getPreSignedUrl(@NotNull HttpMethod httpMethod, @NotNull String bucketName, @NotNull String objectKey, @NotNull Map<String, String> params) throws IOException { try { final Callable<String> resolver = () -> S3Util.withS3Client(ParamUtil.putSslValues(myServerPaths, params), client -> { final GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucketName, objectKey, httpMethod) .withExpiration(new Date(System.currentTimeMillis() + getUrlLifetimeSec() * 1000)); return client.generatePresignedUrl(request).toString(); }); if (httpMethod == HttpMethod.GET) { return TeamCityProperties.getBoolean(TEAMCITY_S3_PRESIGNURL_GET_CACHE_ENABLED) ? myGetLinksCache.get(getCacheIdentity(params, objectKey, bucketName), resolver) : resolver.call(); } else { return resolver.call(); } } catch (Exception e) { final Throwable cause = e.getCause(); final AWSException awsException = cause != null ? new AWSException(cause) : new AWSException(e); final String details = awsException.getDetails(); if (StringUtil.isNotEmpty(details)) { final String message = awsException.getMessage() + details; LOG.warn(message); } throw new IOException(String.format( "Failed to create pre-signed URL to %s artifact '%s' in bucket '%s': %s", httpMethod.name().toLowerCase(), objectKey, bucketName, awsException.getMessage() ), awsException); } }
public SlackWrapper () { this.useAttachment = TeamCityProperties.getBooleanOrTrue("teamcity.notification.slack.useAttachment"); }