public class BatchFileEntry extends AbstractStorageEntry
TransientStore
.
The file can be chunked or not. If it is chunked it references its chunks as BatchChunkEntry
objects.
Batch
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Blob |
chunkedBlob |
protected static org.apache.commons.logging.Log |
log |
protected File |
tmpChunkedFile |
blobs, cachedBlobs, completed, hasBlobs, id, lastStorageSize, params
Constructor and Description |
---|
BatchFileEntry(String id,
Blob blob)
Returns a file entry that holds the given blob, not chunked.
|
BatchFileEntry(String id,
int chunkCount,
String fileName,
String mime,
long fileSize)
Returns a file entry that references the file chunks.
|
Modifier and Type | Method and Description |
---|---|
String |
addChunk(int idx,
Blob blob) |
void |
beforeRemove()
Callback to do some cleanup before entry is removed from the
TransientStore . |
Blob |
getBlob() |
List<Blob> |
getBlobs() |
int |
getChunkCount() |
Collection<String> |
getChunkEntryIds() |
Map<Integer,String> |
getChunks() |
String |
getFileName() |
long |
getFileSize() |
String |
getMimeType() |
List<Integer> |
getOrderedChunkIds() |
boolean |
isChunked() |
boolean |
isChunksCompleted() |
protected void |
transferTo(Blob blob,
File file)
Appends the given blob to the given file.
|
get, getId, getLastStorageSize, getParameters, getSize, isCompleted, load, persist, put, putAll, setBlobs, setCompleted, setLastStorageSize
protected static final org.apache.commons.logging.Log log
protected Blob chunkedBlob
protected File tmpChunkedFile
public BatchFileEntry(String id, Blob blob)
public BatchFileEntry(String id, int chunkCount, String fileName, String mime, long fileSize)
BatchChunkEntry
public boolean isChunked()
public String getFileName()
public String getMimeType()
public long getFileSize()
public int getChunkCount()
public List<Integer> getOrderedChunkIds()
public Collection<String> getChunkEntryIds()
public boolean isChunksCompleted()
protected void transferTo(Blob blob, File file) throws IOException
IOException
public List<Blob> getBlobs()
getBlobs
in interface StorageEntry
getBlobs
in class AbstractStorageEntry
public void beforeRemove()
StorageEntry
TransientStore
.Copyright © 2015 Nuxeo SA. All rights reserved.