org.jets3t.service.multithread
Class DownloadPackage
java.lang.Object
org.jets3t.service.multithread.DownloadPackage
public class DownloadPackage
- extends Object
A simple container object to associate one of an S3Object
or a signed URL string
with an output file or output stream to which the S3 object's data will be written.
This class is used by
S3ServiceMulti.downloadObjects(org.jets3t.service.model.S3Bucket, DownloadPackage[])
to download objects.
- Author:
- James Murty
Constructor Summary |
DownloadPackage(S3Object object,
File outputFile)
|
DownloadPackage(S3Object object,
File outputFile,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
|
DownloadPackage(S3Object object,
OutputStream outputStream)
|
DownloadPackage(S3Object object,
OutputStream outputStream,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
|
DownloadPackage(String signedUrl,
File outputFile,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
|
DownloadPackage(String signedUrl,
OutputStream outputStream,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
|
DownloadPackage
public DownloadPackage(S3Object object,
File outputFile)
DownloadPackage
public DownloadPackage(S3Object object,
File outputFile,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
DownloadPackage
public DownloadPackage(String signedUrl,
File outputFile,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
DownloadPackage
public DownloadPackage(S3Object object,
OutputStream outputStream)
DownloadPackage
public DownloadPackage(S3Object object,
OutputStream outputStream,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
DownloadPackage
public DownloadPackage(String signedUrl,
OutputStream outputStream,
boolean isUnzipping,
EncryptionUtil encryptionUtil)
getObject
public S3Object getObject()
setObject
public void setObject(S3Object object)
getDataFile
public File getDataFile()
- Returns:
- the target output file for data, or null if this package
has an output stream as its target.
getSignedUrl
public String getSignedUrl()
setSignedUrl
public void setSignedUrl(String url)
isSignedDownload
public boolean isSignedDownload()
isAppendToFile
public boolean isAppendToFile()
setAppendToFile
public void setAppendToFile(boolean appendToFile)
- Data will be appended to the target file instead of overwriting it.
This option is relevant only for packages with a target file, not
those with a target output stream.
- Parameters:
appendToFile
-
getOutputStream
public OutputStream getOutputStream()
throws Exception
- Creates an output stream to receive the object's data. The output stream is either
the output stream provided to this package in its constructor, or an
automatically-created FileOutputStream if a File object was provided as the target
output object. The output stream will also be wrapped in a GZipInflatingOutputStream if
isUnzipping is true and/or a decrypting output stream if this package has an associated
non-null EncryptionUtil.
- Returns:
- an output stream that writes data to the output target managed by this class.
- Throws:
Exception