1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-11 08:22:56 +00:00

Updated test with needed params

This commit is contained in:
davigonz
2016-12-15 09:27:14 +01:00
parent 576231023b
commit b9492966a5
3 changed files with 21 additions and 9 deletions
@@ -154,10 +154,15 @@ public class MainActivity extends Activity implements OnRemoteOperationListener,
private void startUpload() {
File upFolder = new File(getCacheDir(), getString(R.string.upload_folder_path));
File fileToUpload = upFolder.listFiles()[0];
File fileToUpload = upFolder.listFiles()[0];
String remotePath = FileUtils.PATH_SEPARATOR + fileToUpload.getName();
String mimeType = getString(R.string.sample_file_mimetype);
UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation(fileToUpload.getAbsolutePath(), remotePath, mimeType);
// Get the last modification date of the file from the file system
Long timeStampLong = fileToUpload.lastModified()/1000;
String timeStamp = timeStampLong.toString();
UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation(fileToUpload.getAbsolutePath(), remotePath, mimeType, timeStamp);
uploadOperation.addDatatransferProgressListener(this);
uploadOperation.execute(mClient, this, mHandler);
}