Class UploadService
- java.lang.Object
-
- com.microsoftopentechnologies.windowsazurestorage.service.StoragePluginService<UploadServiceData>
-
- com.microsoftopentechnologies.windowsazurestorage.service.UploadService
-
- Direct Known Subclasses:
UploadToBlobService
,UploadToFileService
public abstract class UploadService extends StoragePluginService<UploadServiceData>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
UploadService.UploadObject
Data object for https uploading command.protected static class
UploadService.UploadResult
Data object for https uploading result.
-
Field Summary
Fields Modifier and Type Field Description protected static String
ZIP_FOLDER_NAME
protected static String
ZIP_NAME
-
Fields inherited from class com.microsoftopentechnologies.windowsazurestorage.service.StoragePluginService
FP_SEPARATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UploadService(UploadServiceData serviceData)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
excludedFilesAndZip()
int
execute()
protected String
generateWriteSASURL(StorageAccountInfo storageAccountInfo, String fileName, String storageType, String name)
ExecutorService
getExecutorService()
protected String
getItemPath(FilePath path, String embeddedVP, UploadServiceData serviceData)
Convert the path on local file system to relative path on azure storage.protected String
removePrefix(URI srcURI, UploadServiceData serviceData)
protected void
updateAzureBlobs(List<UploadService.UploadResult> results, List<AzureBlob> azureBlobs)
Update Jenkins controller's records of uploaded files.protected Map<String,String>
updateMetadata(Map<String,String> metadata)
protected abstract void
uploadArchive(String archiveIncludes)
protected void
uploadCloudFile(com.azure.storage.file.share.ShareFileClient fileClient, FilePath localPath)
protected abstract void
uploadIndividuals(String embeddedVP, FilePath[] paths)
protected abstract void
uploadIndividuals(String embeddedVP, FilePath[] paths, FilePath workspace)
protected void
waitForUploadEnd()
-
Methods inherited from class com.microsoftopentechnologies.windowsazurestorage.service.StoragePluginService
error, getServiceData, getTime, println, setRunUnstable, setServiceData
-
-
-
-
Field Detail
-
ZIP_FOLDER_NAME
protected static final String ZIP_FOLDER_NAME
- See Also:
- Constant Field Values
-
ZIP_NAME
protected static final String ZIP_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UploadService
protected UploadService(UploadServiceData serviceData)
-
-
Method Detail
-
updateAzureBlobs
protected void updateAzureBlobs(List<UploadService.UploadResult> results, List<AzureBlob> azureBlobs) throws WAStorageException
Update Jenkins controller's records of uploaded files.- Parameters:
results
- Response from the the agents.azureBlobs
- Records of the uploaded files.- Throws:
WAStorageException
- throw exceptions when failing to fetch the the response.
-
generateWriteSASURL
protected String generateWriteSASURL(StorageAccountInfo storageAccountInfo, String fileName, String storageType, String name) throws MalformedURLException, URISyntaxException
-
uploadIndividuals
protected abstract void uploadIndividuals(String embeddedVP, FilePath[] paths, FilePath workspace) throws WAStorageException
- Throws:
WAStorageException
-
uploadIndividuals
protected abstract void uploadIndividuals(String embeddedVP, FilePath[] paths) throws WAStorageException
- Throws:
WAStorageException
-
uploadArchive
protected abstract void uploadArchive(String archiveIncludes) throws WAStorageException
- Throws:
WAStorageException
-
execute
public final int execute() throws WAStorageException
- Specified by:
execute
in classStoragePluginService<UploadServiceData>
- Throws:
WAStorageException
-
waitForUploadEnd
protected void waitForUploadEnd() throws InterruptedException, WAStorageException
-
uploadCloudFile
protected void uploadCloudFile(com.azure.storage.file.share.ShareFileClient fileClient, FilePath localPath) throws WAStorageException
- Throws:
WAStorageException
-
excludedFilesAndZip
protected String excludedFilesAndZip()
-
removePrefix
protected String removePrefix(URI srcURI, UploadServiceData serviceData)
-
getItemPath
protected String getItemPath(FilePath path, String embeddedVP, UploadServiceData serviceData) throws IOException, InterruptedException
Convert the path on local file system to relative path on azure storage.- Parameters:
path
- the local pathembeddedVP
- the embedded virtual path- Returns:
- Throws:
IOException
InterruptedException
-
updateMetadata
protected Map<String,String> updateMetadata(Map<String,String> metadata) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
getExecutorService
public ExecutorService getExecutorService()
-
-