Class AppUploaderService
- java.lang.Object
-
- io.jenkins.plugins.kobiton.services.app.AppUploaderService
-
- All Implemented Interfaces:
AppService
public class AppUploaderService extends Object implements AppService
-
-
Field Summary
-
Fields inherited from interface io.jenkins.plugins.kobiton.services.app.AppService
APP_BASE_URL, APP_UPLOAD_URL
-
-
Constructor Summary
Constructors Constructor Description AppUploaderService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Application
createApplication(Credential credential, String fileName, String appPath)
Create an application or an application version from the file that has been uploaded to S3PreSignedURL
generatePreSignedUploadURL(Credential credential, String fileName, Integer appId)
Create a pre-signed URL for uploading file to S3String
getUrl(String endpoint)
Get URL for API callBoolean
uploadFileToS3(String preSignedUrl, String uploadPath)
Upload binary file to the pre-signed URL that has been created
-
-
-
Method Detail
-
getUrl
public String getUrl(String endpoint)
Get URL for API call- Specified by:
getUrl
in interfaceAppService
-
generatePreSignedUploadURL
public PreSignedURL generatePreSignedUploadURL(Credential credential, String fileName, Integer appId) throws IOException
Create a pre-signed URL for uploading file to S3- Parameters:
credential
- credentialfileName
- file name- Returns:
- PreSignedURL object { appPath: path for application or application version creation url: pre-signed URL for file uploading }
- Throws:
IOException
- IOException
-
uploadFileToS3
public Boolean uploadFileToS3(String preSignedUrl, String uploadPath) throws IOException
Upload binary file to the pre-signed URL that has been created- Parameters:
preSignedUrl
- pre-signed URL for uploading file to S3uploadPath
- path to file- Returns:
- true if no error was thrown
- Throws:
IOException
- IOException
-
createApplication
public Application createApplication(Credential credential, String fileName, String appPath) throws IOException
Create an application or an application version from the file that has been uploaded to S3- Parameters:
credential
- credentialfileName
- file nameappPath
- path returned when created pre-signed URL- Returns:
- Application object { appId, versionId }
- Throws:
IOException
- IOException
-
-