use of com.owncloud.android.ui.activity.ComponentsGetter in project android by nextcloud.
the class RemoveFileDialogFragment method onConfirmation.
/**
* Performs the removal of the target file, both locally and in the server.
*/
@Override
public void onConfirmation(String callerTag) {
ComponentsGetter cg = (ComponentsGetter) getActivity();
FileDataStorageManager storageManager = cg.getStorageManager();
if (storageManager.getFileById(mTargetFile.getFileId()) != null) {
ArrayList<OCFile> list = new ArrayList<>();
list.add(mTargetFile);
cg.getFileOperationsHelper().removeFiles(list, false);
}
}
use of com.owncloud.android.ui.activity.ComponentsGetter in project android by nextcloud.
the class RemoveFilesDialogFragment method onCancel.
/**
* Performs the removal of the local copy of the target file
*/
@Override
public void onCancel(String callerTag) {
ComponentsGetter cg = (ComponentsGetter) getActivity();
cg.getFileOperationsHelper().removeFiles(mTargetFiles, true);
}
use of com.owncloud.android.ui.activity.ComponentsGetter in project android by owncloud.
the class RemoveFilesDialogFragment method onConfirmation.
/**
* Performs the removal of the target file, both locally and in the server.
*/
@Override
public void onConfirmation(String callerTag) {
ComponentsGetter cg = (ComponentsGetter) getActivity();
cg.getFileOperationsHelper().removeFiles(mTargetFiles, false);
}
use of com.owncloud.android.ui.activity.ComponentsGetter in project android by owncloud.
the class RemoveFilesDialogFragment method onCancel.
/**
* Performs the removal of the local copy of the target file
*/
@Override
public void onCancel(String callerTag) {
ComponentsGetter cg = (ComponentsGetter) getActivity();
cg.getFileOperationsHelper().removeFiles(mTargetFiles, true);
}
use of com.owncloud.android.ui.activity.ComponentsGetter in project android by nextcloud.
the class RemoveFileDialogFragment method onCancel.
/**
* Performs the removal of the local copy of the target file
*/
@Override
public void onCancel(String callerTag) {
ComponentsGetter cg = (ComponentsGetter) getActivity();
ArrayList<OCFile> list = new ArrayList<>();
list.add(mTargetFile);
cg.getFileOperationsHelper().removeFiles(list, true);
FileDataStorageManager storageManager = cg.getStorageManager();
boolean containsFavorite = false;
if (mTargetFile.isFolder()) {
List<OCFile> files = storageManager.getFolderContent(mTargetFile, false);
for (OCFile file : files) {
containsFavorite = file.isAvailableOffline() || containsFavorite;
if (containsFavorite) {
break;
}
}
}
// or is a folder and contains favorite
if (mTargetFile.isAvailableOffline() || containsFavorite) {
OCFile folder = null;
if (mTargetFile.isFolder()) {
folder = mTargetFile;
} else {
folder = storageManager.getFileById(mTargetFile.getParentId());
}
folder.setEtag("");
storageManager.saveFile(folder);
}
}
Aggregations