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 BlobcreateBlob(byte[] data) Create a blob from a byte array.static MemoryBlobCreate aMemoryBlobinstance.static OverflowableBlobcreateOverflowableBlob(int threshold, String tempPrefix, String tempSuffix, File tempDirectory) Create anOverflowableBlobthat overflows to a temporary file.static OverflowableBlobcreateOverflowableBlob(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 aMemoryBlobinstance.- 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 anOverflowableBlobthat 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, ornullif the default temporary directory is to be used- Returns:
- the blob
-