use of org.structr.web.entity.FileBase in project structr by structr.
the class CloudConnection method finishFile.
public void finishFile(final FileNodeEndChunk endChunk) throws FrameworkException {
final FileNodeDataContainer container = fileMap.get(endChunk.getContainerId());
if (container == null) {
logger.warn("Received file end chunk for ID {} without file, this should not happen!", endChunk.getContainerId());
} else {
container.flushAndCloseTemporaryFile();
final NodeInterface newNode = storeNode(container);
if (newNode instanceof FileBase) {
try {
container.persistTemporaryFile(((FileBase) newNode).getFileOnDisk().getAbsolutePath());
} catch (Throwable t) {
// do not catch specific exception only, we need to be able to shut
// down the connection gracefully, so we must make sure not to be
// interrupted here
logger.warn("Unable to persist file {}: {}", newNode, t.getMessage());
}
}
count++;
total++;
}
}
Aggregations