public class ResourceUtil extends Object
Constructor and Description |
---|
ResourceUtil() |
Modifier and Type | Method and Description |
---|---|
static Document |
buildDocument(byte[] content,
String fileName) |
static Document |
buildDocument(File file,
String fileName) |
static Document |
buildDocument(InputStream inputStream,
String fileName) |
static Document |
buildDocument(String xmlContent,
String fileName) |
static void |
copyNewSequenceToExistingSequences(String sequenceDirectoryFilePath,
String sequenceName)
To copy a new sequence to existing ones
|
static void |
deployPolicy(String fileName,
String content) |
static String |
getApiPath(int tenantID,
String tenantDomain) |
static String |
getArtifactUIContentFromConfig(String payload)
Returns the content configuration from a RXT file
|
static String |
getExecutionPlanPath() |
static String |
getResourceContent(Object content) |
static String |
getRxtResourceLocation(String apiName,
String apiVersion,
String apiProvider)
location for the rxt of the api
|
static String |
getSwagger12ResourceLocation(String apiName,
String apiVersion,
String apiProvider)
location for the swagger 1.2 resources
|
static String |
getSwagger2ResourceLocation(String apiName,
String apiVersion,
String apiProvider)
location for the swagger v2.0 resources
|
static List<SynapseDTO> |
getVersionedAPIs(String apiFilePath) |
static void |
handleException(String msg,
Throwable e)
To handle exceptions
|
static boolean |
isConsumerKeyValid(String consumerKey) |
static void |
transformXMLDocument(Document document,
File file) |
static void |
updateSynapseAPI(Document document,
File file)
To update synapse API
|
public static String getSwagger12ResourceLocation(String apiName, String apiVersion, String apiProvider)
apiName
- api nameapiVersion
- api versionapiProvider
- api providerpublic static String getSwagger2ResourceLocation(String apiName, String apiVersion, String apiProvider)
apiName
- name of the APIapiVersion
- version of the APIapiProvider
- provider name of the APIpublic static String getRxtResourceLocation(String apiName, String apiVersion, String apiProvider)
apiName
- name of the APIapiVersion
- version of the APIapiProvider
- provider name of the APIpublic static void handleException(String msg, Throwable e) throws APIMigrationException
msg
- error messageAPIMigrationException
public static void copyNewSequenceToExistingSequences(String sequenceDirectoryFilePath, String sequenceName) throws APIMigrationException
sequenceDirectoryFilePath
- sequence directorysequenceName
- sequence nameAPIMigrationException
public static void updateSynapseAPI(Document document, File file) throws APIMigrationException
document
- XML document objectfile
- synapse fileAPIMigrationException
public static Document buildDocument(String xmlContent, String fileName) throws APIMigrationException
APIMigrationException
public static Document buildDocument(byte[] content, String fileName) throws APIMigrationException
APIMigrationException
public static Document buildDocument(InputStream inputStream, String fileName) throws APIMigrationException
APIMigrationException
public static Document buildDocument(File file, String fileName) throws APIMigrationException
APIMigrationException
public static void deployPolicy(String fileName, String content) throws APIMigrationException
APIMigrationException
public static String getExecutionPlanPath() throws APIMigrationException
APIMigrationException
public static List<SynapseDTO> getVersionedAPIs(String apiFilePath)
public static boolean isConsumerKeyValid(String consumerKey)
public static String getArtifactUIContentFromConfig(String payload) throws org.wso2.carbon.registry.core.exceptions.RegistryException
payload
- org.wso2.carbon.registry.core.exceptions.RegistryException
Copyright © 2024 WSO2. All rights reserved.