com.teamscale.jacoco.agent.upload.azure.AzureFileStorageConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of teamscale-jacoco-agent Show documentation
Show all versions of teamscale-jacoco-agent Show documentation
JVM profiler that simplifies various aspects around recording and uploading test coverage
package com.teamscale.jacoco.agent.upload.azure;
import com.teamscale.jacoco.agent.options.AgentOptionParseException;
import com.teamscale.jacoco.agent.options.AgentOptionsParser;
import okhttp3.HttpUrl;
/** Config necessary to upload files to an azure file storage. */
public class AzureFileStorageConfig {
/** The URL to the azure file storage */
public HttpUrl url;
/** The access key of the azure file storage */
public String accessKey;
/** Checks if none of the required fields is null. */
public boolean hasAllRequiredFieldsSet() {
return url != null && accessKey != null;
}
/** Checks if all required fields are null. */
public boolean hasAllRequiredFieldsNull() {
return url == null && accessKey == null;
}
/**
* Handles all command-line options prefixed with 'azure-'
*
* @return true if it has successfully processed the given option.
*/
public static boolean handleAzureFileStorageOptions(AzureFileStorageConfig azureFileStorageConfig, String key,
String value)
throws AgentOptionParseException {
switch (key) {
case "azure-url":
azureFileStorageConfig.url = AgentOptionsParser.parseUrl(key, value);
return true;
case "azure-key":
azureFileStorageConfig.accessKey = value;
return true;
default:
return false;
}
}
}