IBlobManagementOptions
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.
Methods
Method | Description |
---|---|
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. |
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. |
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. |
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. |
getTempFilesRootPath() | The root path where temporary files will be created. |
setTempFilesRootPath(String value) | The root path where temporary files will be created. |
getMaxBlobsBytesInMemory() | Defines the maximum total size (in bytes) that all BLOBs may occupy in memory. |
setMaxBlobsBytesInMemory(long value) | Defines the maximum total size (in bytes) that all BLOBs may occupy in memory. |
getPresentationLockingBehavior()
public abstract 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();
Returns: int
setPresentationLockingBehavior(int value)
public abstract 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();
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
isTemporaryFilesAllowed()
public abstract 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.
All files will be deleted after work with the presentation will be finished.
Returns: boolean
setTemporaryFilesAllowed(boolean value)
public abstract 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.
All files will be deleted after work with the presentation will be finished.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
getTempFilesRootPath()
public abstract String getTempFilesRootPath()
The root path where temporary files will be created. System temorary directory will be used by default. Hosting process should have permissions to create files and folders there.
Returns: java.lang.String
setTempFilesRootPath(String value)
public abstract void setTempFilesRootPath(String value)
The root path where temporary files will be created. System temorary directory will be used by default. Hosting process should have permissions to create files and folders there.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
getMaxBlobsBytesInMemory()
public abstract long getMaxBlobsBytesInMemory()
Defines the maximum total size (in bytes) that all BLOBs may occupy in memory. By default, all BLOBs are loaded into memory; only once this limit is reached are alternative mechanisms (such as temporary files) employed. Keeping BLOBs in memory maximizes performance but can lead to high memory usage. Use this property to tailor behavior to your environment or requirements.
This property is ignored if #isTemporaryFilesAllowed.isTemporaryFilesAllowed/#setTemporaryFilesAllowed(boolean).setTemporaryFilesAllowed(boolean) is set to false, since memory is then the only storage location available and limiting in-memory BLOB usage has no effect.
The default value is 629,145,600 bytes (600 MB).
You may set this property to zero, but a small minimum amount of memory will still be reserved.
Returns: long
setMaxBlobsBytesInMemory(long value)
public abstract void setMaxBlobsBytesInMemory(long value)
Defines the maximum total size (in bytes) that all BLOBs may occupy in memory. By default, all BLOBs are loaded into memory; only once this limit is reached are alternative mechanisms (such as temporary files) employed. Keeping BLOBs in memory maximizes performance but can lead to high memory usage. Use this property to tailor behavior to your environment or requirements.
This property is ignored if #isTemporaryFilesAllowed.isTemporaryFilesAllowed/#setTemporaryFilesAllowed(boolean).setTemporaryFilesAllowed(boolean) is set to false, since memory is then the only storage location available and limiting in-memory BLOB usage has no effect.
The default value is 629,145,600 bytes (600 MB).
You may set this property to zero, but a small minimum amount of memory will still be reserved.
Parameters:
Parameter | Type | Description |
---|---|---|
value | long |