Class BatchFileEntry
- java.lang.Object
-
- org.nuxeo.ecm.automation.server.jaxrs.batch.BatchFileEntry
-
public class BatchFileEntry extends Object
Represents a batch file backed by theTransientStore.The file can be chunked or not. If it is chunked it references its chunks as
TransientStoreentry keys.- Since:
- 7.4
- See Also:
Batch
-
-
Field Summary
Fields Modifier and Type Field Description protected Blobblobprotected BlobchunkedBlobprotected Stringkeyprotected static Loglogprotected Map<String,Serializable>paramsprotected TransientStoretransientStore
-
Constructor Summary
Constructors Modifier Constructor Description protectedBatchFileEntry(TransientStore transientStore, String key, boolean chunked)BatchFileEntry(TransientStore transientStore, String key, int chunkCount, String fileName, String mimeType, long fileSize)Returns a file entry that references the file chunks.BatchFileEntry(TransientStore transientStore, String key, Map<String,Serializable> params)Returns a file entry that holds the given parameters.BatchFileEntry(TransientStore transientStore, String key, Blob blob)Returns a file entry that holds the given blob, not chunked.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddChunk(int index, Blob blob)voidbeforeRemove()BlobgetBlob()protected BlobgetChunk(TransientStore ts, String key)intgetChunkCount()Collection<String>getChunkEntryKeys()Map<Integer,String>getChunks()StringgetFileName()longgetFileSize()StringgetKey()StringgetMimeType()List<Integer>getOrderedChunkIndexes()Map<String,Serializable>getParams()booleanisChunked()booleanisChunksCompleted()protected voidtransferTo(Blob blob, File file)Appends the given blob to the given file.
-
-
-
Field Detail
-
log
protected static final Log log
-
transientStore
protected TransientStore transientStore
-
key
protected String key
-
params
protected Map<String,Serializable> params
-
blob
protected Blob blob
-
chunkedBlob
protected Blob chunkedBlob
-
-
Constructor Detail
-
BatchFileEntry
public BatchFileEntry(TransientStore transientStore, String key, Blob blob)
Returns a file entry that holds the given blob, not chunked.
-
BatchFileEntry
public BatchFileEntry(TransientStore transientStore, String key, int chunkCount, String fileName, String mimeType, long fileSize)
Returns a file entry that references the file chunks.
-
BatchFileEntry
public BatchFileEntry(TransientStore transientStore, String key, Map<String,Serializable> params)
Returns a file entry that holds the given parameters.
-
BatchFileEntry
protected BatchFileEntry(TransientStore transientStore, String key, boolean chunked)
-
-
Method Detail
-
getKey
public String getKey()
-
getParams
public Map<String,Serializable> getParams()
-
isChunked
public boolean isChunked()
-
getFileName
public String getFileName()
-
getMimeType
public String getMimeType()
-
getFileSize
public long getFileSize()
-
getChunkCount
public int getChunkCount()
-
getChunkEntryKeys
public Collection<String> getChunkEntryKeys()
-
isChunksCompleted
public boolean isChunksCompleted()
-
getBlob
public Blob getBlob()
-
getChunk
protected Blob getChunk(TransientStore ts, String key)
-
transferTo
protected void transferTo(Blob blob, File file) throws IOException
Appends the given blob to the given file.- Throws:
IOException
-
beforeRemove
public void beforeRemove()
-
-