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 StringAPI_URLstatic StringDEFAULT_TEST_PROPERTIESDefault workspace configuration file class path WARNING: don't push back this file to github as it contains many secrets.static StringPUBLISH_URL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ContextgetAuthContext(Map<String,String> configMap)static JwtContext.BuildergetJwtContextBuilder(Map<String,String> configMap)static OAuthContext.BuildergetOAuthContextBuilder(Map<String,String> configMap)static Optional<PrivateKey>getPrivateKey(Map<String,String> configMap)static StringgetSystemProperty(String key)static StringgetSystemProperty(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:propertyClassPathstatic Workspace.BuildergetSystemWorkspaceBuilder()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_PROPERTIESstatic Map<String,String>getSystemWorkspaceConfig(String propertiesClassPath)static Workspace.BuildergetWorkspaceBuilder(Map<String,String> configMap)static booleanisOAuthConfig(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/resourcesfolder- 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
-
-