public class GatewayCmdUtils extends Object
| Constructor and Description |
|---|
GatewayCmdUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFilesToSources(String sourcePath,
String destinationPath)
Copy files to resources directory
|
static void |
copyFolder(String source,
String destination)
This function recursively copy all the sub folder and files from source to destination file paths
|
static void |
createLabelConfig(String root,
String label)
Create initial label configuration
|
static void |
createLabelGWDistribution(String projectRoot,
String labelName)
Create a micro gateway distribution for the provided label
|
static void |
createLabelProjectStructure(String root,
String labelName)
Create a project structure for a particular label.
|
static void |
createMainConfig(String root)
Creates main config file resides in PROJECT_ROOT/conf
|
static void |
createMainProjectStructure(String root)
Create the main structure of the project for all the labels
|
static CliLauncherException |
createUsageException(String errorMsg)
Create usage exception
|
static String |
decrypt(String value,
String secret)
Decrypt given value with provided secret
|
static String |
encrypt(String value,
String secret)
Encrypt given value with provided secret
|
static String |
getCLIHome()
Get cli home location
|
static CodeGenerationContext |
getCodeGenerationContext() |
static Config |
getConfig() |
static String |
getConfigFolderLocation()
Get config folder location
|
static ContainerConfig |
getContainerConfig() |
static String |
getFiltersFolderLocation()
Get filters folder location
|
static String |
getLabelConfigDirPath(String root,
String label)
Returns path to the label conf folder in the project root
|
static String |
getLabelConfigLocation(String root,
String labelName)
Returns location of the main configuration file of given project root
|
static String |
getLabelDirectoryPath(String root,
String labelName)
Returns path to the given label project in the project root path
|
static String |
getLabelSrcDirectoryPath(String root,
String labelName)
Returns path to the /src of a given label project in the project root path
|
static String |
getMainConfigDirPath(String root)
Returns path to the conf folder in the project root
|
static String |
getMainConfigLocation(String root)
Returns location of the main configuration file of given project root
|
static String |
getResourceFolderLocation()
Get resources file directory path
|
static String |
getStoredWorkspaceLocation()
Retrieve stored workspace location
|
static String |
makeFirstLetterLowerCase(String s)
Convert first letter to lower case
|
static String |
readFileAsString(String path,
boolean inResource)
Read file as string
|
static void |
setCodeGenerationContext(CodeGenerationContext codeGenerationContext) |
static void |
setConfig(Config configFromFile) |
static void |
setContainerConfig(ContainerConfig containerConfig) |
static void |
storeWorkspaceLocation(String workspacePath)
Store workspace location
|
public static Config getConfig()
public static void setConfig(Config configFromFile)
public static void setCodeGenerationContext(CodeGenerationContext codeGenerationContext)
public static CodeGenerationContext getCodeGenerationContext()
public static String readFileAsString(String path, boolean inResource) throws IOException
path - to the fileinResource - whether file is in resources directory of jar or notIOException - if file read went wrongpublic static CliLauncherException createUsageException(String errorMsg)
errorMsg - error messagepublic static String makeFirstLetterLowerCase(String s)
s - stringpublic static String encrypt(String value, String secret)
value - value to encryptsecret - encryption keypublic static String decrypt(String value, String secret)
value - value to decryptsecret - decryption keypublic static void storeWorkspaceLocation(String workspacePath) throws IOException
workspacePath - project workspace locationIOException - if file write went wrongpublic static String getStoredWorkspaceLocation() throws IOException
IOException - if file read went wrongpublic static String getCLIHome()
public static String getResourceFolderLocation()
public static String getFiltersFolderLocation()
public static String getConfigFolderLocation()
public static void createMainProjectStructure(String root)
root - Root location to create the structurepublic static void createLabelProjectStructure(String root, String labelName)
root - project root locationlabelName - name of the labelpublic static void createLabelGWDistribution(String projectRoot, String labelName) throws IOException
projectRoot - project root locationlabelName - name of the labelIOException - erro while creating micro gateway distributionpublic static String getMainConfigDirPath(String root)
root - project root locationpublic static String getMainConfigLocation(String root)
root - project root locationpublic static String getLabelConfigDirPath(String root, String label)
root - project root locationpublic static String getLabelConfigLocation(String root, String labelName)
root - project root locationpublic static String getLabelDirectoryPath(String root, String labelName)
root - project root locationlabelName - name of the labelpublic static String getLabelSrcDirectoryPath(String root, String labelName)
root - project root locationlabelName - name of the labelpublic static void createMainConfig(String root) throws IOException
root - project root locationIOException - error while creating the main config filepublic static void copyFolder(String source, String destination) throws IOException
source - source locationdestination - destination locationIOException - error while copying folder to destinationpublic static void copyFilesToSources(String sourcePath, String destinationPath) throws IOException
sourcePath - source directory pathdestinationPath - destionation directory pathIOException - if file copy went wrongpublic static void createLabelConfig(String root, String label) throws IOException
root - workspace locationlabel - label nameIOException - if file create went wrongpublic static ContainerConfig getContainerConfig()
public static void setContainerConfig(ContainerConfig containerConfig)
Copyright © 2018 WSO2. All rights reserved.