Package com.adobe.aio.util
Class WorkspaceUtil
- java.lang.Object
-
- com.adobe.aio.util.WorkspaceUtil
-
public class WorkspaceUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
API_URL
static String
DEFAULT_TEST_PROPERTIES
Default workspace configuration file class path WARNING: don't push back this file to github as it contains many secrets.static String
PUBLISH_URL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Context
getAuthContext(Map<String,String> configMap)
static JwtContext.Builder
getJwtContextBuilder(Map<String,String> configMap)
static OAuthContext.Builder
getOAuthContextBuilder(Map<String,String> configMap)
static Optional<PrivateKey>
getPrivateKey(Map<String,String> configMap)
static String
getSystemProperty(String key)
static String
getSystemProperty(String key, String propertyClassPath)
Loads a property from either one of the following sources, probing it first to check that the required property is given, in order: System Properties Environment Variables classpath:propertyClassPath
static Workspace.Builder
getSystemWorkspaceBuilder()
Loads Workspace from either one and only one of the following sources, probing them first to check that all the required properties are given, in order: System Properties Environment Variables classpath:DEFAULT_TEST_PROPERTIES
static Map<String,String>
getSystemWorkspaceConfig(String propertiesClassPath)
static Workspace.Builder
getWorkspaceBuilder(Map<String,String> configMap)
static boolean
isOAuthConfig(Map<String,String> configMap)
-
-
-
Field Detail
-
API_URL
public static final String API_URL
- See Also:
- Constant Field Values
-
PUBLISH_URL
public static final String PUBLISH_URL
- See Also:
- Constant Field Values
-
DEFAULT_TEST_PROPERTIES
public static final String DEFAULT_TEST_PROPERTIES
Default workspace configuration file class path WARNING: don't push back this file to github as it contains many secrets. We do provide a sample properties files in the./src/test/resources
folder- See Also:
- Constant Field Values
-
-
Method Detail
-
getSystemWorkspaceBuilder
public static Workspace.Builder getSystemWorkspaceBuilder()
Loads Workspace from either one and only one of the following sources, probing them first to check that all the required properties are given, in order:- System Properties
- Environment Variables
- classpath:
DEFAULT_TEST_PROPERTIES
- Returns:
- a Workspace.Builder loaded with the provided config
-
getWorkspaceBuilder
public static Workspace.Builder getWorkspaceBuilder(Map<String,String> configMap)
-
getOAuthContextBuilder
public static OAuthContext.Builder getOAuthContextBuilder(Map<String,String> configMap)
-
getJwtContextBuilder
public static JwtContext.Builder getJwtContextBuilder(Map<String,String> configMap)
-
getPrivateKey
public static Optional<PrivateKey> getPrivateKey(Map<String,String> configMap)
-
getSystemProperty
public static String getSystemProperty(String key, String propertyClassPath)
Loads a property from either one of the following sources, probing it first to check that the required property is given, in order:- System Properties
- Environment Variables
- classpath:
propertyClassPath
- Parameters:
key
- the property namepropertyClassPath
- the classpath of the property file- Returns:
- the value of the property
-
-