当前位置: 首页>>代码示例>>Java>>正文


Java RemoteOperation类代码示例

本文整理汇总了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();
	}
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:23,代码来源:MainActivity.java

示例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);
    }
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:22,代码来源:Downloader_OC.java

示例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();
    }
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:14,代码来源:OC_ConnectionCheck.java

示例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());
    }
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:32,代码来源:OC_ReadFolderStructure.java

示例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;
    }
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:10,代码来源:ConnectionCheck_OC.java

示例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);
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:6,代码来源:CreateRemoteFolderOperation.java

示例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();
    }
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:48,代码来源:OC_DownloadTask.java


注:本文中的com.owncloud.android.lib.common.operations.RemoteOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。