Class AppUploaderService

    • Constructor Detail

      • AppUploaderService

        public AppUploaderService()
    • Method Detail

      • generatePreSignedUploadURL

        public PreSignedURL generatePreSignedUploadURL​(Credential credential,
                                                       String fileName,
                                                       Integer appId)
                                                throws IOException
        Create a pre-signed URL for uploading file to S3
        Parameters:
        credential - credential
        fileName - 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 S3
        uploadPath - 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 - credential
        fileName - file name
        appPath - path returned when created pre-signed URL
        Returns:
        Application object { appId, versionId }
        Throws:
        IOException - IOException