|
@@ -522,9 +522,6 @@ public class OperationsService extends Service {
|
|
|
mService.dispatchResultToOperationListeners(mCurrentOperation, result);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -557,7 +554,7 @@ public class OperationsService extends Service {
|
|
|
|
|
|
String action = operationIntent.getAction();
|
|
|
|
|
|
- if (action.equals(ACTION_CREATE_SHARE_VIA_LINK)) { // Create public share via link
|
|
|
+ if (ACTION_CREATE_SHARE_VIA_LINK.equals(action)) { // Create public share via link
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
String password = operationIntent.getStringExtra(EXTRA_SHARE_PASSWORD);
|
|
|
if (remotePath.length() > 0) {
|
|
@@ -600,7 +597,7 @@ public class OperationsService extends Service {
|
|
|
((UpdateSharePermissionsOperation)operation).setPassword(password);
|
|
|
}
|
|
|
|
|
|
- } else if (action.equals(ACTION_CREATE_SHARE_WITH_SHAREE)) {
|
|
|
+ } else if (ACTION_CREATE_SHARE_WITH_SHAREE.equals(action)) {
|
|
|
// Create private share with user or group
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
String shareeName = operationIntent.getStringExtra(EXTRA_SHARE_WITH);
|
|
@@ -615,7 +612,7 @@ public class OperationsService extends Service {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- } else if (action.equals(ACTION_UNSHARE)) { // Unshare file
|
|
|
+ } else if (ACTION_UNSHARE.equals(action)) { // Unshare file
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
ShareType shareType = (ShareType) operationIntent.
|
|
|
getSerializableExtra(EXTRA_SHARE_TYPE);
|
|
@@ -629,11 +626,11 @@ public class OperationsService extends Service {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- } else if (action.equals(ACTION_GET_SERVER_INFO)) {
|
|
|
+ } else if (ACTION_GET_SERVER_INFO.equals(action)) {
|
|
|
// check OC server and get basic information from it
|
|
|
operation = new GetServerInfoOperation(serverUrl, OperationsService.this);
|
|
|
|
|
|
- } else if (action.equals(ACTION_OAUTH2_GET_ACCESS_TOKEN)) {
|
|
|
+ } else if (ACTION_OAUTH2_GET_ACCESS_TOKEN.equals(action)) {
|
|
|
/// GET ACCESS TOKEN to the OAuth server
|
|
|
String oauth2QueryParameters =
|
|
|
operationIntent.getStringExtra(EXTRA_OAUTH2_QUERY_PARAMETERS);
|
|
@@ -643,17 +640,17 @@ public class OperationsService extends Service {
|
|
|
getString(R.string.oauth2_grant_type),
|
|
|
oauth2QueryParameters);
|
|
|
|
|
|
- } else if (action.equals(ACTION_GET_USER_NAME)) {
|
|
|
+ } else if (ACTION_GET_USER_NAME.equals(action)) {
|
|
|
// Get User Name
|
|
|
operation = new GetRemoteUserInfoOperation();
|
|
|
|
|
|
- } else if (action.equals(ACTION_RENAME)) {
|
|
|
+ } else if (ACTION_RENAME.equals(action)) {
|
|
|
// Rename file or folder
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
String newName = operationIntent.getStringExtra(EXTRA_NEWNAME);
|
|
|
operation = new RenameFileOperation(remotePath, newName);
|
|
|
|
|
|
- } else if (action.equals(ACTION_REMOVE)) {
|
|
|
+ } else if (ACTION_REMOVE.equals(action)) {
|
|
|
// Remove file or folder
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
boolean onlyLocalCopy = operationIntent.getBooleanExtra(EXTRA_REMOVE_ONLY_LOCAL, false);
|
|
@@ -661,20 +658,20 @@ public class OperationsService extends Service {
|
|
|
operation = new RemoveFileOperation(remotePath, onlyLocalCopy, account, inBackground,
|
|
|
getApplicationContext());
|
|
|
|
|
|
- } else if (action.equals(ACTION_CREATE_FOLDER)) {
|
|
|
+ } else if (ACTION_CREATE_FOLDER.equals(action)) {
|
|
|
// Create Folder
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
boolean createFullPath = operationIntent.getBooleanExtra(EXTRA_CREATE_FULL_PATH, true);
|
|
|
operation = new CreateFolderOperation(remotePath, createFullPath);
|
|
|
|
|
|
- } else if (action.equals(ACTION_SYNC_FILE)) {
|
|
|
+ } else if (ACTION_SYNC_FILE.equals(action)) {
|
|
|
// Sync file
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
boolean syncFileContents = operationIntent.getBooleanExtra(EXTRA_SYNC_FILE_CONTENTS, true);
|
|
|
operation = new SynchronizeFileOperation(remotePath, account, syncFileContents,
|
|
|
getApplicationContext());
|
|
|
|
|
|
- } else if (action.equals(ACTION_SYNC_FOLDER)) {
|
|
|
+ } else if (ACTION_SYNC_FOLDER.equals(action)) {
|
|
|
// Sync folder (all its descendant files are sync'ed)
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
operation = new SynchronizeFolderOperation(
|
|
@@ -684,22 +681,22 @@ public class OperationsService extends Service {
|
|
|
System.currentTimeMillis() // TODO remove this dependency from construction time
|
|
|
);
|
|
|
|
|
|
- } else if (action.equals(ACTION_MOVE_FILE)) {
|
|
|
+ } else if (ACTION_MOVE_FILE.equals(action)) {
|
|
|
// Move file/folder
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
String newParentPath = operationIntent.getStringExtra(EXTRA_NEW_PARENT_PATH);
|
|
|
operation = new MoveFileOperation(remotePath, newParentPath);
|
|
|
|
|
|
- } else if (action.equals(ACTION_COPY_FILE)) {
|
|
|
+ } else if (ACTION_COPY_FILE.equals(action)) {
|
|
|
// Copy file/folder
|
|
|
String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
|
|
|
String newParentPath = operationIntent.getStringExtra(EXTRA_NEW_PARENT_PATH);
|
|
|
operation = new CopyFileOperation(remotePath, newParentPath);
|
|
|
|
|
|
- } else if (action.equals(ACTION_CHECK_CURRENT_CREDENTIALS)) {
|
|
|
+ } else if (ACTION_CHECK_CURRENT_CREDENTIALS.equals(action)) {
|
|
|
// Check validity of currently stored credentials for a given account
|
|
|
operation = new CheckCurrentCredentialsOperation(account);
|
|
|
- } else if (action.equals(ACTION_RESTORE_VERSION)) {
|
|
|
+ } else if (ACTION_RESTORE_VERSION.equals(action)) {
|
|
|
FileVersion fileVersion = operationIntent.getParcelableExtra(EXTRA_FILE_VERSION);
|
|
|
String userId = operationIntent.getStringExtra(EXTRA_USER_ID);
|
|
|
operation = new RestoreFileVersionOperation(fileVersion.getRemoteId(), fileVersion.getFileName(),
|