logger.info("No api key specified. Uploading results anonymously.");
} else {
try {
apiKey = Optional.of(UUID.fromString(apiKeyString));
} catch (IllegalArgumentException e) {
throw new InvalidConfigurationException(String.format(
"The specified API key (%s) is not valid. API keys are UUIDs and should look like %s.",
apiKeyString, new UUID(0L, 0L)));
}
}
this.apiKey = apiKey;
@Nullable String urlString = resultProcessorConfig.options().get("url");
if (Strings.isNullOrEmpty(urlString)) {
logger.info("No upload URL was specified. Results will not be uploaded.");
this.uploadUri = Optional.absent();
} else {
try {
this.uploadUri = Optional.of(new URI(urlString).resolve(POST_PATH));
} catch (URISyntaxException e) {
throw new InvalidConfigurationException(urlString + " is an invalid upload url", e);
}
}
}