Search in sources :

Example 1 with CreateRemoteFolderOperation

use of com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation in project android by owncloud.

the class CreateFolderOperation method run.

@Override
protected RemoteOperationResult run(OwnCloudClient client) {
    CreateRemoteFolderOperation createRemoteFolderOperation = new CreateRemoteFolderOperation(mRemotePath, mCreateFullPath);
    RemoteOperationResult result = createRemoteFolderOperation.execute(client);
    if (result.isSuccess()) {
        OCFile newDir = saveFolderInDB();
        String localPath = FileStorageUtils.getDefaultSavePathFor(getStorageManager().getAccount().name, newDir);
        File localFile = new File(localPath);
        boolean created = localFile.mkdirs();
        if (!created) {
            Timber.w("Local folder " + localPath + " was not fully created");
        }
    } else {
        Timber.e("%s hasn't been created", mRemotePath);
    }
    return result;
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) RemoteOperationResult(com.owncloud.android.lib.common.operations.RemoteOperationResult) CreateRemoteFolderOperation(com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation) OCFile(com.owncloud.android.datamodel.OCFile) File(java.io.File)

Aggregations

OCFile (com.owncloud.android.datamodel.OCFile)1 RemoteOperationResult (com.owncloud.android.lib.common.operations.RemoteOperationResult)1 CreateRemoteFolderOperation (com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation)1 File (java.io.File)1