|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jets3t.service.utils.ObjectUtils
public class ObjectUtils
Utility class for preparing files for upload into S3, or for download from S3. The methods in this class build the appropriate objects to wrap uploaded files or objects in S3 that will be downloaded to a local file.
Constructor Summary | |
---|---|
ObjectUtils()
|
Method Summary | |
---|---|
static S3Object |
createObjectForUpload(java.lang.String objectKey,
java.io.File dataFile,
EncryptionUtil encryptionUtil,
boolean gzipFile)
Prepares a file for upload to a named object in S3, potentially transforming it if zipping or encryption is requested. |
static S3Object |
createObjectForUpload(java.lang.String objectKey,
java.io.File dataFile,
EncryptionUtil encryptionUtil,
boolean gzipFile,
BytesProgressWatcher progressWatcher)
Prepares a file for upload to a named object in S3, potentially transforming it if zipping or encryption is requested. |
static DownloadPackage |
createPackageForDownload(S3Object object,
java.io.File fileTarget,
boolean automaticUnzip,
boolean automaticDecrypt,
java.lang.String encryptionPassword)
Creates a download package representing an S3Object that will be downloaded, and the target file the downloaded data will be written to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectUtils()
Method Detail |
---|
public static S3Object createObjectForUpload(java.lang.String objectKey, java.io.File dataFile, EncryptionUtil encryptionUtil, boolean gzipFile, BytesProgressWatcher progressWatcher) throws java.lang.Exception
The file will have the following metadata items added:
objectKey
- the object key name to use in S3dataFile
- the file to prepare for upload.encryptionUtil
- if this variable is null no encryption will be applied, otherwise the provided
encryption utility object will be used to encrypt the file's data.gzipFile
- if true the file will be Gzipped.progressWatcher
- watcher to monitor progress of file transformation and hash generation.
java.lang.Exception
- exceptions could include IO failures, gzipping and encryption failures.public static S3Object createObjectForUpload(java.lang.String objectKey, java.io.File dataFile, EncryptionUtil encryptionUtil, boolean gzipFile) throws java.lang.Exception
The file will have the following metadata items added:
objectKey
- the object key name to use in S3dataFile
- the file to prepare for upload.encryptionUtil
- if this variable is null no encryption will be applied, otherwise the provided
encryption utility object will be used to encrypt the file's data.gzipFile
- if true the file will be Gzipped.
java.lang.Exception
- exceptions could include IO failures, gzipping and encryption failures.public static DownloadPackage createPackageForDownload(S3Object object, java.io.File fileTarget, boolean automaticUnzip, boolean automaticDecrypt, java.lang.String encryptionPassword) throws java.lang.Exception
Downloaded data may be transformed if the S3Object is encrypted or gzipped and the appropriate options are set.
object
- the object in S3fileTarget
- the file to which downloaded (and possibly transformed) data will be written.automaticUnzip
- if true, gzipped objects will be decrypted on-the-fly as they are downloaded.automaticDecrypt
- if true, encrypted files will be decrypted on-the-fly as they are downloaded (in which
case the encryptionPassword must be correct)encryptionPassword
- the password required to decrypt encrypted objects.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |