use of org.wso2.carbon.apimgt.impl.importexport.ExportFormat in project carbon-apimgt by wso2.
the class ImportExportAPIServiceImpl method exportAPI.
@Override
public File exportAPI(String apiId, String revisionUUID, boolean preserveStatus, ExportFormat format, boolean preserveDocs, boolean preserveCredentials, String organization) throws APIManagementException, APIImportExportException {
APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider();
String userName = RestApiCommonUtil.getLoggedInUsername();
APIIdentifier apiIdentifier = APIMappingUtil.getAPIIdentifierFromUUID(apiId);
API api = apiProvider.getAPIbyUUID(revisionUUID, organization);
api.setUuid(apiId);
apiIdentifier.setUuid(apiId);
APIDTO apiDtoToReturn = APIMappingUtil.fromAPItoDTO(api, preserveCredentials, apiProvider);
return ExportUtils.exportApi(apiProvider, apiIdentifier, apiDtoToReturn, api, userName, format, preserveStatus, preserveDocs, StringUtils.EMPTY, organization);
}
Aggregations