X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/7ebcda4d810a5b509fc51766536fa0918ecf8d82..8361540852ec87b51c85937e0f326a83e19cd8ad:/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 1f78aa1b..413a76e2 100644 --- a/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java +++ b/src/com/owncloud/android/operations/ChunkedUploadFileOperation.java @@ -22,7 +22,6 @@ import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; -import java.nio.channels.FileLock; import java.util.Random; import org.apache.commons.httpclient.HttpException; @@ -46,9 +45,10 @@ public class ChunkedUploadFileOperation extends UploadFileOperation { public ChunkedUploadFileOperation( Account account, OCFile file, boolean isInstant, - boolean forceOverwrite) { + boolean forceOverwrite, + int localBehaviour) { - super(account, file, isInstant, forceOverwrite); + super(account, file, isInstant, forceOverwrite, localBehaviour); } @Override @@ -56,13 +56,11 @@ public class ChunkedUploadFileOperation extends UploadFileOperation { int status = -1; FileChannel channel = null; - FileLock lock = null; RandomAccessFile raf = null; try { File file = new File(getStoragePath()); - raf = new RandomAccessFile(file, "rw"); + raf = new RandomAccessFile(file, "r"); channel = raf.getChannel(); - lock = channel.tryLock(); ChunkFromFileChannelRequestEntity entity = new ChunkFromFileChannelRequestEntity(channel, getMimeType(), CHUNK_SIZE, file); entity.addOnDatatransferProgressListeners(getDataTransferListeners()); long offset = 0; @@ -81,8 +79,6 @@ public class ChunkedUploadFileOperation extends UploadFileOperation { } } finally { - if (lock != null) - lock.release(); if (channel != null) channel.close(); if (raf != null)