try {
out = new FileOutputStream(fileName, false);
long fileSize = writeDatabaseChunk(1, chunk, out);
for (int chunkNum = 2; !chunk.last; chunkNum++) {
final Object result = sendRequest(databaseName, null, Collections.singleton(r.getKey()), new OCopyDatabaseChunkTask(
chunk.filePath, chunkNum, chunk.offset + chunk.buffer.length), EXECUTION_MODE.RESPONSE);
if (result instanceof Boolean)
continue;
else if (result instanceof Exception) {