public final class APIImportUtil extends Object
| Constructor and Description |
|---|
APIImportUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
extractArchive(File sourceFile,
String destination)
This method decompresses API the archive
|
static void |
importAPI(String pathToArchive,
String currentUser,
boolean isDefaultProviderAllowed)
This method imports an API
|
static void |
initializeProvider(String currentUserName)
This method initializes the Provider when there is a direct request to import an API
|
static void |
transferFile(InputStream uploadedInputStream,
String newFileName,
String storageLocation)
This method uploads a given file to specified location
|
public static void initializeProvider(String currentUserName) throws APIExportException
currentUserName - the current logged in userAPIExportException - if provider cannot be initializedpublic static void transferFile(InputStream uploadedInputStream, String newFileName, String storageLocation) throws APIImportException
uploadedInputStream - input stream of the filenewFileName - name of the file to be createdstorageLocation - destination of the new fileAPIImportException - if the file transfer failspublic static String extractArchive(File sourceFile, String destination) throws APIImportException
sourceFile - The archive containing the APIdestination - location of the archive to be extractedAPIImportException - If the decompressing failspublic static void importAPI(String pathToArchive, String currentUser, boolean isDefaultProviderAllowed) throws APIImportException
pathToArchive - location of the extracted folder of the APIcurrentUser - the current logged in userisDefaultProviderAllowed - decision to keep or replace the providerAPIImportException - if there is an error in importing an APICopyright © 2018 WSO2 Inc. All rights reserved.