本文整理汇总了Java中com.owncloud.android.lib.common.operations.RemoteOperation类的典型用法代码示例。如果您正苦于以下问题:Java RemoteOperation类的具体用法?Java RemoteOperation怎么用?Java RemoteOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RemoteOperation类属于com.owncloud.android.lib.common.operations包,在下文中一共展示了RemoteOperation类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRemoteOperationFinish
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
if (!result.isSuccess()) {
Toast.makeText(this, R.string.todo_operation_finished_in_fail, Toast.LENGTH_SHORT).show();
Log.e(LOG_TAG, result.getLogMessage(), result.getException());
} else if (operation instanceof ReadRemoteFolderOperation) {
onSuccessfulRefresh((ReadRemoteFolderOperation)operation, result);
} else if (operation instanceof UploadRemoteFileOperation ) {
onSuccessfulUpload((UploadRemoteFileOperation)operation, result);
} else if (operation instanceof RemoveRemoteFileOperation ) {
onSuccessfulRemoteDeletion((RemoveRemoteFileOperation)operation, result);
} else if (operation instanceof DownloadRemoteFileOperation ) {
onSuccessfulDownload((DownloadRemoteFileOperation)operation, result);
} else {
Toast.makeText(this, R.string.todo_operation_finished_in_success, Toast.LENGTH_SHORT).show();
}
}
示例2: onRemoteOperationFinish
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
if (loginRequest.get()) {
if (operation instanceof ReadRemoteFolderOperation) {
if (result.isSuccess()) {
if (DEBUG) Log.d(TAG, "operation successful, login/connection success");
loginResultSuccess.set(true);
} else {
if (DEBUG) Log.d(TAG, "operation unsuccessful, login/connection failed");
}
}
mThreadCounter.getAndDecrement();
loginRequest.set(false);
return;
}
if (operation instanceof ReadRemoteFolderOperation) {
handleReadOperation(result);
} else if (operation instanceof DownloadRemoteFileOperation) {
handleDownloadOperation(result);
}
}
示例3: onRemoteOperationFinish
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
if (operation instanceof ReadRemoteFolderOperation) {
if (result.isSuccess()) {
if (DEBUG) Log.i(TAG, "Could connect to owncloud: " + result.getLogMessage());
//MainActivity.mConnCheckOC = true;
} else {
if (DEBUG) Log.i(TAG, "Could NOT connect to owncloud: " + result.getLogMessage());
//MainActivity.mConnCheckOC = false;
}
mThreadCounter.getAndDecrement();
}
}
示例4: onRemoteOperationFinish
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
if (operation instanceof ReadRemoteFolderOperation) {
if (result.isSuccess()) {
ArrayList files = (ArrayList)result.getData();
for(int i=0; i < files.size(); i++){
if (i==0) continue; // don't include first element in list as that is the read folder itself
RemoteFile remoteFile = (RemoteFile) files.get(i);
String mimeType = remoteFile.getMimeType();
switch (mimeType) {
case "DIR":
if (DEBUG) Log.i(TAG, "remote folder[" + mimeType + "]: " + remoteFile.getRemotePath());
remoteReadAnyFolder(remoteFile.getRemotePath());
break;
case "image/jpeg":
case "image/png":
if (DEBUG) Log.i(TAG, "remote file[" + mimeType + "]: " + remoteFile.getRemotePath());
if (!remoteFileList.contains(remoteFile)) {
remoteFileList.add(remoteFile);
}
break;
default:
if (DEBUG) Log.i(TAG, "WRONG file[" + mimeType + "]: " + remoteFile.getRemotePath());
break;
}
}
}
mThreadCounter.getAndDecrement();
if (DEBUG) Log.i(TAG, "Threadcounter after read operation: " + mThreadCounter.get());
}
}
示例5: onRemoteOperationFinish
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
@Override
public void onRemoteOperationFinish(RemoteOperation caller, RemoteOperationResult result) {
if (caller instanceof ReadRemoteFolderOperation) {
if (result.isSuccess()) {
loginSuccess = true;
}
taskDone = true;
}
}
示例6: createParentFolder
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
private RemoteOperationResult createParentFolder(String parentPath, OwnCloudClient client) {
RemoteOperation operation = new CreateRemoteFolderOperation(parentPath,
mCreateFullPath);
return operation.execute(client);
}
示例7: onRemoteOperationFinish
import com.owncloud.android.lib.common.operations.RemoteOperation; //导入依赖的package包/类
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
if (operation instanceof ReadRemoteFolderOperation) {
if (result.isSuccess()) {
ArrayList files = (ArrayList)result.getData();
for(int i=0; i < files.size(); i++){
if (i==0) continue; // don't include first element in list as that is the read folder itself
RemoteFile remoteFile = (RemoteFile) files.get(i);
String mimeType = remoteFile.getMimeType();
switch (mimeType) {
case "DIR":
if (DEBUG) Log.i(TAG, "remote folder[" + mimeType + "]: " + remoteFile.getRemotePath());
remoteReadAnyFolder(remoteFile.getRemotePath());
break;
case "image/jpeg":
case "image/png":
if (DEBUG) Log.i(TAG, "remote file[" + mimeType + "]: " + remoteFile.getRemotePath());
if (!remoteFileList.contains(remoteFile)) {
remoteFileList.add(remoteFile);
}
break;
default:
if (DEBUG) Log.i(TAG, "WRONG file[" + mimeType + "]: " + remoteFile.getRemotePath());
break;
}
}
}
mThreadCounter.getAndDecrement();
if (DEBUG) Log.i(TAG, "Threadcounter after read operation: " + mThreadCounter.get());
} else if (operation instanceof DownloadRemoteFileOperation) {
if (result.isSuccess()) {
if (DEBUG) Log.d(TAG, "Download: success -- info:" + result.getFilename()); // LogMessage: success, status code 200
try {
mDownloadedFiles.put(result.getFilename());
} catch (InterruptedException e) {
if (DEBUG) Log.e(TAG, "Couldn't put the downloaded file (" + result.getFilename() + ") on the list of downloaded files");
e.printStackTrace();
}
mDownloadedFilesCount.getAndIncrement();
publishProgress( (float) // is between 0 and 1
( (float)mDownloadedFilesCount.get() / (float)mRemoteFilesToDownloadList.size() ));
} else {
if (DEBUG) Log.e(TAG, "Download: FAILURE -- info:" + result.getFilename() + " = " + result.getLogMessage());
}
mThreadCounter.getAndDecrement();
}
}