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
TransientStore
entry keys.- Since:
- 7.4
- See Also:
Batch
-
-
Field Summary
Fields Modifier and Type Field Description protected Blob
blob
protected Blob
chunkedBlob
protected String
key
protected static Log
log
protected Map<String,Serializable>
params
protected TransientStore
transientStore
-
Constructor Summary
Constructors Modifier Constructor Description protected
BatchFileEntry(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 String
addChunk(int index, Blob blob)
void
beforeRemove()
Blob
getBlob()
protected Blob
getChunk(TransientStore ts, String key)
int
getChunkCount()
Collection<String>
getChunkEntryKeys()
Map<Integer,String>
getChunks()
String
getFileName()
long
getFileSize()
String
getKey()
String
getMimeType()
List<Integer>
getOrderedChunkIndexes()
Map<String,Serializable>
getParams()
boolean
isChunked()
boolean
isChunksCompleted()
protected void
transferTo(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()
-
-