use of org.apache.chemistry.opencmis.commons.impl.dataobjects.FailedToDeleteDataImpl in project structr by structr.
the class CMISObjectService method deleteTree.
@Override
public FailedToDeleteData deleteTree(final String repositoryId, final String folderId, final Boolean allVersions, final UnfileObject unfileObjects, final Boolean continueOnFailure, final ExtensionsData extension) {
if (UnfileObject.UNFILE.equals(unfileObjects)) {
throw new CmisNotSupportedException("Unfiling not supported");
}
final App app = StructrApp.getInstance(securityContext);
final FailedToDeleteDataImpl result = new FailedToDeleteDataImpl();
result.setIds(new LinkedList<String>());
try (final Tx tx = app.tx()) {
final Folder folder = app.get(Folder.class, folderId);
if (folder != null) {
recursivelyCheckAndDeleteFiles(app, result, folder, continueOnFailure);
} else {
throw new CmisObjectNotFoundException("Folder with ID " + folderId + " does not exist");
}
tx.success();
} catch (final FrameworkException fex) {
logger.warn("", fex);
}
return result;
}
Aggregations