X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/b00957b5fa28651b588292b9696648af6dc52636..a2d4e98a7e831cde099fa7185c8553998aa76cf4:/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java diff --git a/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java b/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java index 97d3eba6..b481f4d2 100644 --- a/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java +++ b/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java @@ -58,9 +58,11 @@ public class ChunkedUploadFileOperation extends UploadFileOperation { PutMethod put = null; FileChannel channel = null; FileLock lock = null; + RandomAccessFile raf = null; try { File file = new File(getLocalPath()); - channel = new RandomAccessFile(file, "rw").getChannel(); + raf = new RandomAccessFile(file, "rw"); + channel = raf.getChannel(); lock = channel.tryLock(); ChunkFromFileChannelRequestEntity entity = new ChunkFromFileChannelRequestEntity(channel, getMimeType(), CHUNK_SIZE); entity.setOnDatatransferProgressListener(getDataTransferListener()); @@ -84,6 +86,8 @@ public class ChunkedUploadFileOperation extends UploadFileOperation { lock.release(); if (channel != null) channel.close(); + if (raf != null) + raf.close(); if (put != null) put.releaseConnection(); // let the connection available for other methods }