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

Refactor parameter user_agent out of RemoteOperation and children

This commit is contained in:
masensio
2015-03-24 14:31:40 +01:00
parent 94ac3a93d3
commit 9990eeb7ff
29 changed files with 96 additions and 166 deletions
@@ -79,8 +79,7 @@ public class MainActivity extends Activity implements OnRemoteOperationListener,
mHandler = new Handler();
Uri serverUri = Uri.parse(getString(R.string.server_base_url));
mClient = OwnCloudClientFactory.createOwnCloudClient(serverUri, this, true,
getString(R.string.user_agent));
mClient = OwnCloudClientFactory.createOwnCloudClient(serverUri, this, true);
mClient.setCredentials(
OwnCloudCredentialsFactory.newBasicCredentials(
getString(R.string.username),
@@ -150,7 +149,7 @@ public class MainActivity extends Activity implements OnRemoteOperationListener,
private void startRefresh() {
ReadRemoteFolderOperation refreshOperation = new ReadRemoteFolderOperation(FileUtils.PATH_SEPARATOR);
refreshOperation.execute(mClient, getString(R.string.user_agent), this, mHandler);
refreshOperation.execute(mClient, this, mHandler);
}
private void startUpload() {
@@ -160,7 +159,7 @@ public class MainActivity extends Activity implements OnRemoteOperationListener,
String mimeType = getString(R.string.sample_file_mimetype);
UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation(fileToUpload.getAbsolutePath(), remotePath, mimeType);
uploadOperation.addDatatransferProgressListener(this);
uploadOperation.execute(mClient, getString(R.string.user_agent), this, mHandler);
uploadOperation.execute(mClient, this, mHandler);
}
private void startRemoteDeletion() {
@@ -168,7 +167,7 @@ public class MainActivity extends Activity implements OnRemoteOperationListener,
File fileToUpload = upFolder.listFiles()[0];
String remotePath = FileUtils.PATH_SEPARATOR + fileToUpload.getName();
RemoveRemoteFileOperation removeOperation = new RemoveRemoteFileOperation(remotePath);
removeOperation.execute(mClient, getString(R.string.user_agent), this, mHandler);
removeOperation.execute(mClient, this, mHandler);
}
private void startDownload() {
@@ -179,7 +178,7 @@ public class MainActivity extends Activity implements OnRemoteOperationListener,
String remotePath = FileUtils.PATH_SEPARATOR + fileToUpload.getName();
DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(remotePath, downFolder.getAbsolutePath());
downloadOperation.addDatatransferProgressListener(this);
downloadOperation.execute(mClient, getString(R.string.user_agent), this, mHandler);
downloadOperation.execute(mClient, this, mHandler);
}
@SuppressWarnings("deprecation")