public interface IBlobManagementOptions
A Binary Large Object (BLOB) is a binary data stored as a single entity - i.e. BLOB can be an
audio, video or presentation itself. A number of techniques are used to optimize memory consumption
while working with BLOBs - which was already stored in the presentation or be added later programmatically.
Using IBlobManagementOptions
you can change a different behavior aspects regarding BLOBs
handling for the IPresentation
instance lifetime.
Modifier and Type | Method and Description |
---|---|
long |
getMaxBlobsBytesInMemory()
Defines the maximum amount (in bytes) that all BLOBs in total may occupy in memory.
|
int |
getPresentationLockingBehavior()
This property defines if an instance of the Presentation class can be an owner of the source - file
or stream during the instance lifetime.
|
java.lang.String |
getTempFilesRootPath()
The root path where temporary files will be created.
|
boolean |
isTemporaryFilesAllowed()
This property defines if temporary files can be created while working with BLOBs, what greatly
decreases the memory consumption but requires permissions to create files.
|
void |
setMaxBlobsBytesInMemory(long value)
Defines the maximum amount (in bytes) that all BLOBs in total may occupy in memory.
|
void |
setPresentationLockingBehavior(int value)
This property defines if an instance of the Presentation class can be an owner of the source - file
or stream during the instance lifetime.
|
void |
setTempFilesRootPath(java.lang.String value)
The root path where temporary files will be created.
|
void |
setTemporaryFilesAllowed(boolean value)
This property defines if temporary files can be created while working with BLOBs, what greatly
decreases the memory consumption but requires permissions to create files.
|
int getPresentationLockingBehavior()
This property defines if an instance of the Presentation class can be an owner of the source - file or stream during the instance lifetime. If the instance is an owner, it locks the source. This helps to improve memory consumption and performance while working with BLOBs, but the source (stream or file) can't be changed during Presentation's instance lifetime. This is an example:
LoadOptions loadOptions = new LoadOptions(); loadOptions.getBlobManagementOptions().setPresentationLockingBehavior(PresentationLockingBehavior.KeepLocked); Presentation pres = new Presentation("pres.pptx", loadOptions); // IOException will be thrown because pres.pptx is locked for a Presentation lifetime // java.io.File f = new java.io.File("pres.pptx"); // f.delete(); // after Presentation object disposed, file is unlocked and can be deleted java.io.File f = new java.io.File("pres.pptx"); f.delete();
void setPresentationLockingBehavior(int value)
This property defines if an instance of the Presentation class can be an owner of the source - file or stream during the instance lifetime. If the instance is an owner, it locks the source. This helps to improve memory consumption and performance while working with BLOBs, but the source (stream or file) can't be changed during Presentation's instance lifetime. This is an example:
LoadOptions loadOptions = new LoadOptions(); loadOptions.getBlobManagementOptions().setPresentationLockingBehavior(PresentationLockingBehavior.KeepLocked); Presentation pres = new Presentation("pres.pptx", loadOptions); // IOException will be thrown because pres.pptx is locked for a Presentation lifetime // java.io.File f = new java.io.File("pres.pptx"); // f.delete(); // after Presentation object disposed, file is unlocked and can be deleted java.io.File f = new java.io.File("pres.pptx"); f.delete();
boolean isTemporaryFilesAllowed()
This property defines if temporary files can be created while working with BLOBs, what greatly decreases the memory consumption but requires permissions to create files.
void setTemporaryFilesAllowed(boolean value)
This property defines if temporary files can be created while working with BLOBs, what greatly decreases the memory consumption but requires permissions to create files.
java.lang.String getTempFilesRootPath()
The root path where temporary files will be created. Hosting process should have permissions to create files and folders there.
void setTempFilesRootPath(java.lang.String value)
The root path where temporary files will be created. Hosting process should have permissions to create files and folders there.
long getMaxBlobsBytesInMemory()
Defines the maximum amount (in bytes) that all BLOBs in total may occupy in memory. First, all BLOBs loading into memory as default behavior and only when it reaches the limit defined by this property, other mechanisms (such as temporary files) can be involved. In terms of performance, the most efficient way is storing BLOBs in memory, but from the other side, it leads to a high memory consumption what may be undesirable. Using this property, you may set the optimal behavior for your environment or other requirements.
IsTemporaryFilesAllowed
(isTemporaryFilesAllowed()
/setTemporaryFilesAllowed(boolean)
) is
set to false. It makes no sense to limit the maximum BLOBs in memory, because if
IsTemporaryFilesAllowed
(isTemporaryFilesAllowed()
/setTemporaryFilesAllowed(boolean)
) is set to false, the memory is the only place
where BLOBs can be stored.void setMaxBlobsBytesInMemory(long value)
Defines the maximum amount (in bytes) that all BLOBs in total may occupy in memory. First, all BLOBs loading into memory as default behavior and only when it reaches the limit defined by this property, other mechanisms (such as temporary files) can be involved. In terms of performance, the most efficient way is storing BLOBs in memory, but from the other side, it leads to a high memory consumption what may be undesirable. Using this property, you may set the optimal behavior for your environment or other requirements.
IsTemporaryFilesAllowed
(isTemporaryFilesAllowed()
/setTemporaryFilesAllowed(boolean)
) is
set to false. It makes no sense to limit the maximum BLOBs in memory, because if
IsTemporaryFilesAllowed
(isTemporaryFilesAllowed()
/setTemporaryFilesAllowed(boolean)
) is set to false, the memory is the only place
where BLOBs can be stored.