public class LargeFileOptions
extends java.lang.Object
Due to limitations of the Entrust Archive format, it is not possible to
stream the processing of the file being protected. This means that, when
protecting a file using Entrust Archive format (via ArchiveCreator),
the data contained in the input file must be buffered internally. By
default, ArchiveCreator, simply buffers the data to memory.
This limits the amount of data than can be processed (input file size) to
slightly less than half of the maximum available memory.
However, instead of buffering all data to memory, it is possible to buffer a portion of the data to memory and the remainder to a series of temporary files. This reduces the memory requirements during Entrust Archive format creation, and allows large files to be protected using Entrust Archive format.
To protect a large file using Entrust Archive format, an instance of this
class must be provided to the constructor of ArchiveCreator.
This object will provide all the necessary information (options); each
option is described below:
java.io.tmpdir).
For the options that are OPTIONAL, these values can be set to
null, in which case default values will automatically be used.
ArchiveCreator| Constructor and Description |
|---|
LargeFileOptions()
Creates a new set of Entrust Archive large file options from default
option values.
|
LargeFileOptions(int memorySizeMB,
int storageFileSizeMB,
java.io.File storageDirectory,
java.lang.String storageFilePrefix,
java.lang.String storageFileSuffix)
Creates a new set of Entrust Archive large file options from user supplied
option values.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMemorySizeMB()
Returns the amount of memory storage in MBs.
|
java.io.File |
getStorageDirectory()
Gets the directory where all temporary storage files will be written.
|
java.lang.String |
getStorageFilePrefix()
Returns the file name prefix used when creating temporary storage files.
|
int |
getStorageFileSizeMB()
Returns the size of the temporary storage files in MBs; each storage file
created will not exceed this size.
|
java.lang.String |
getStorageFileSuffix()
Returns the file name suffix used when creating temporary storage files.
|
void |
setMemorySizeMB(int memorySizeMB)
Sets the amount of memory storage in MBs.
|
void |
setStorageDirectory(java.io.File storageDirectory)
Sets the directory where all temporary storage files will be written.
|
void |
setStorageFilePrefix(java.lang.String storageFilePrefix)
Sets the file name prefix used when creating temporary storage files.
|
void |
setStorageFileSizeMB(int storageFileSizeMB)
Sets the size of the temporary storage files in MBs; each storage file
created will not exceed this size.
|
void |
setStorageFileSuffix(java.lang.String storageFileSuffix)
Sets the file name suffix used when creating temporary storage files.
|
public LargeFileOptions()
The following default values are used for the required options:
public LargeFileOptions(int memorySizeMB,
int storageFileSizeMB,
java.io.File storageDirectory,
java.lang.String storageFilePrefix,
java.lang.String storageFileSuffix)
memorySizeMB - the amount of memory storage in MBs; when less than 1MB, memory storage
is not usedstorageFileSizeMB - the size of the temporary storage files in MBs; must be at least 1MBstorageDirectory - the directory where all storage files will be written, or
null if the default temporary-file directory is to be used
(OPTIONAL)storageFilePrefix - the prefix string to be used in generating the storage file names; must
be at least three characters longstorageFileSuffix - the suffix string to be used in generating the storage file names; may
be null, in which case the suffix ".tmp" (OPTIONAL)public int getMemorySizeMB()
public void setMemorySizeMB(int memorySizeMB)
memorySizeMB - the amount of memory storage in MBs; when less than 1MB, memory storage
is not usedjava.lang.IllegalArgumentException - if the memory storage size exceeds the maximum available or maximum
addressable memorypublic int getStorageFileSizeMB()
public void setStorageFileSizeMB(int storageFileSizeMB)
storageFileSizeMB - the size of the temporary storage files in MBsjava.lang.IllegalArgumentException - if the temporary storage file size is less than 1MBpublic java.io.File getStorageDirectory()
null if not setpublic void setStorageDirectory(java.io.File storageDirectory)
storageDirectory - the directory where all temporary storage files will be written, or
null if the default temporary-file directory is to be used
(OPTIONAL)java.lang.IllegalArgumentException - if the directory where temporary storage files will be written does not
represent a directory on the system, or does not permit write operationspublic java.lang.String getStorageFilePrefix()
public void setStorageFilePrefix(java.lang.String storageFilePrefix)
storageFilePrefix - the file name prefix used when creating temporary storage filesjava.lang.IllegalArgumentException - if the storage file prefix is null or less than three
characterspublic java.lang.String getStorageFileSuffix()
public void setStorageFileSuffix(java.lang.String storageFileSuffix)
storageFileSuffix - the file name suffix used when creating temporary storage files, or
null if not set