use of dev.dworks.apps.anexplorer.root.RootFile in project AnExplorer by 1hakr.
the class RootedStorageProvider method moveDocument.
@Override
public String moveDocument(String sourceDocumentId, String sourceParentDocumentId, String targetParentDocumentId) throws FileNotFoundException {
final RootFile before = getRootFileForDocId(sourceDocumentId);
final RootFile after = new RootFile(getRootFileForDocId(targetParentDocumentId).getPath(), before.getName());
if (!RootCommands.renameRootTarget(before, after)) {
throw new IllegalStateException("Failed to rename " + before);
}
final String afterDocId = getDocIdForRootFile(after);
if (!TextUtils.equals(sourceDocumentId, afterDocId)) {
notifyDocumentsChanged(afterDocId);
return afterDocId;
} else {
return null;
}
}
Aggregations