Package org.apache.axiom.blob
Class Blobs
java.lang.Object
org.apache.axiom.blob.Blobs
Contains factory methods to create various types of blobs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Blob
createBlob
(byte[] data) Create a blob from a byte array.static MemoryBlob
Create aMemoryBlob
instance.static OverflowableBlob
createOverflowableBlob
(int threshold, String tempPrefix, String tempSuffix, File tempDirectory) Create anOverflowableBlob
that overflows to a temporary file.static OverflowableBlob
createOverflowableBlob
(int threshold, WritableBlobFactory<?> overflowBlobFactory) Create anOverflowableBlob
.
-
Method Details
-
createBlob
Create a blob from a byte array.- Parameters:
data
- the byte array- Returns:
- the blob
-
createMemoryBlob
Create aMemoryBlob
instance.- Returns:
- the blob
-
createOverflowableBlob
public static OverflowableBlob createOverflowableBlob(int threshold, WritableBlobFactory<?> overflowBlobFactory) Create anOverflowableBlob
.- Parameters:
threshold
- the threshold above which data is transferred to the overflow bloboverflowBlobFactory
- the factory that will be used to create the overflow blob- Returns:
- the blob
-
createOverflowableBlob
public static OverflowableBlob createOverflowableBlob(int threshold, String tempPrefix, String tempSuffix, File tempDirectory) Create anOverflowableBlob
that overflows to a temporary file. Temporary files are created usingFile.createTempFile(String, String, File)
.- Parameters:
threshold
- the overflow thresholdtempPrefix
- the prefix to be used in generating the name of the temporary filetempSuffix
- the suffix to be used in generating the name of the temporary filetempDirectory
- the directory in which the temporary file is to be created, ornull
if the default temporary directory is to be used- Returns:
- the blob
-