/* ownCloud Android client application
* Copyright (C) 2012 Bartek Przybylski
+ * Copyright (C) 2012-2013 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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;
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
int status = -1;
FileChannel channel = null;
- FileLock lock = null;
RandomAccessFile raf = null;
try {
File file = new File(getStoragePath());
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;
}
} finally {
- if (lock != null)
- lock.release();
if (channel != null)
channel.close();
if (raf != null)