本文整理汇总了Java中org.apache.chemistry.opencmis.commons.enums.UnfileObject类的典型用法代码示例。如果您正苦于以下问题:Java UnfileObject类的具体用法?Java UnfileObject怎么用?Java UnfileObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnfileObject类属于org.apache.chemistry.opencmis.commons.enums包,在下文中一共展示了UnfileObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteCampagneFolder
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public Boolean deleteCampagneFolder(String codCampagne){
logger.debug("Suppression du dossier de campagne : "+codCampagne);
Session session = getCmisSession();
try{
/*Dossier de base pour les candidats*/
Folder master = getFolderCandidat();
/*Le dossier de la campagne*/
Folder folderCampagne = FileUtils.getFolder(master.getPath()+"/"+codCampagne, session);
logger.debug("Suppression du dossier de campagne, path="+folderCampagne.getPath()+", id="+folderCampagne.getId());
List<String> liste = folderCampagne.deleteTree(true, UnfileObject.DELETE, true);
if (liste !=null && liste.size()>0){
return false;
}
return true;
}catch(Exception e){
logger.error("Impossible de supprimer le dossier de campagne : "+codCampagne+", vous devez le supprimer à la main",e);
return false;
}
}
示例2: deleteAllContent
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
protected void deleteAllContent() {
Session session = createSession();
Folder rootFolder = session.getRootFolder();
ItemIterable<CmisObject> children = rootFolder.getChildren();
for (CmisObject cmisObject : children) {
if ("cmis:folder".equals(cmisObject.getPropertyValue(PropertyIds.OBJECT_TYPE_ID))) {
List<String> notDeltedIdList = ((Folder)cmisObject)
.deleteTree(true, UnfileObject.DELETE, true);
if (notDeltedIdList != null && notDeltedIdList.size() > 0) {
throw new RuntimeException("Cannot empty repo");
}
} else {
cmisObject.delete(true);
}
}
session.getBinding().close();
}
示例3: deleteTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public FailedToDeleteData deleteTree(
String repositoryId, String folderId, Boolean allVersions,
UnfileObject unfileObjects, final Boolean continueOnFailure, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
if (!allVersions)
{
throw new CmisInvalidArgumentException("Only allVersions=true supported!");
}
if (unfileObjects == UnfileObject.UNFILE)
{
throw new CmisInvalidArgumentException("Unfiling not supported!");
}
final NodeRef folderNodeRef = getOrCreateFolderInfo(folderId, "Folder").getNodeRef();
final FailedToDeleteDataImpl result = new FailedToDeleteDataImpl();
try
{
connector.deleteNode(folderNodeRef, true);
}
catch (Exception e)
{
List<String> ids = new ArrayList<String>();
ids.add(folderId);
result.setIds(ids);
}
return result;
}
示例4: removeTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
public List<String> removeTree(String objectId, boolean allVersions, UnfileObject unfile, boolean continueOnFailure)
{
CmisObject o = getObject(objectId);
if(o instanceof Folder)
{
Folder f = (Folder)o;
List<String> res = f.deleteTree(allVersions, unfile, continueOnFailure);
return res;
}
else
{
throw new IllegalArgumentException("Object does not exist or is not a folder");
}
}
示例5: deleteFolder
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public void deleteFolder(String path, Session session) throws Exception {
// Disable cache
session.getDefaultContext().setCacheEnabled(false);
if (path.endsWith("/")) path = path.substring(0, path.length()-1);
Folder folder = (Folder)FileUtils.getObject(path, session);
folder.deleteTree(true, UnfileObject.DELETE, true);
// Enable cache
session.getDefaultContext().setCacheEnabled(true);
}
示例6: removeTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
public List<String> removeTree(String objectId, boolean allVersions, UnfileObject unfile, boolean continueOnFailure)
{
CmisObject o = getObject(objectId);
if(o instanceof Folder)
{
Folder f = (Folder)o;
List<String> res = f.deleteTree(allVersions, unfile, continueOnFailure);
return res;
}
else
{
throw new IllegalArgumentException("Object does not exist or is not a folder");
}
}
示例7: processCMISEvent
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
protected EventResult processCMISEvent(Event event) throws Exception
{
CMISEventData data = (CMISEventData) event.getData();
// A quick double-check
if (data == null)
{
return new EventResult("Unable to get CMIS root folder; no session provided.", false);
}
LinkedList<Folder> breadcrumb = data.getBreadcrumb();
if (breadcrumb.size() < 2)
{
return new EventResult("We need at least two folders to work with.", false);
}
// Delete the last folder
Folder folder = breadcrumb.getLast();
folder.deleteTree(true, UnfileObject.DELETE, false);
// Append it to the breadcrumb
data.getBreadcrumb().removeLast();
// Done
Event doneEvent = new Event(eventNameFolderDeleted, data);
EventResult result = new EventResult(
BasicDBObjectBuilder
.start()
.append("msg", "Successfully deleted folder.")
.push("folder")
.append("id", folder.getId())
.append("name", folder.getName())
.pop()
.get(),
doneEvent);
// Done
return result;
}
示例8: removePurgeableResources
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
// Asynchronous invocation - tenant and uuid required (!)
public void removePurgeableResources(String tenantId, String uuid) {
Session session = createSession();
Folder multitenantRootFolder = (Folder) session.getObjectByPath("/" + tenantId);
Folder uuidFolder = getPurgableUuidFolder(session, uuid, multitenantRootFolder, repoFolderNestingLevels, false);
uuidFolder.deleteTree(true, UnfileObject.DELETE, false);
}
示例9: removeResource
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public void removeResource(String uuid) {
Session session = createSession();
Folder multitenantRootFolder = (Folder) session.getObjectByPath("/" + multiTenantContextResolver.resolveCurrentTenantIdentifier());
Folder uuidFolder = getUuidFolder(session, uuid, multitenantRootFolder, repoFolderNestingLevels, false);
uuidFolder.deleteTree(true, UnfileObject.DELETE, false);
}
示例10: deleteResource
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
/**
* deletes a file or folder from the VFS
* @param vfsPath the path of the resource to be deleted (full root path, e.g.
* <code>/system/modules/com.mycompany.mymodule/formatters/delete_me.jsp</code>)
*/
public boolean deleteResource(String vfsPath) {
if (!connected) {
LOG.warn("not connected");
return false;
}
boolean success = false;
CmisObject vfsFile = null;
try {
vfsFile = getVfsObject(vfsPath);
}
catch (CmsPermissionDeniedException e) {
LOG.warn("Can't delete " + vfsPath + ", permission denied", e);
}
if (vfsFile != null) {
// Folders
if (vfsFile instanceof Folder) {
LOG.info("Deleting the following folder from the VFS: "+vfsPath);
List<String> failedResourcePaths = ((Folder)vfsFile).deleteTree(true, UnfileObject.DELETE, true);
success = failedResourcePaths == null || failedResourcePaths.size() <= 0;
}
// Files
else {
LOG.info("Deleting the following file from the VFS: "+vfsPath);
vfsFile.delete();
success = true;
}
}
return success;
}
示例11: deleteFolder
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
/**
* Recursively delete a folder.
*
* @param folderPath path of the folder to delete
* @return the paths of folder and documents that could not be deleted
*/
public Collection<String> deleteFolder(String folderPath) {
List<String> failed = getBareFolder(folderPath).deleteTree(true, UnfileObject.DELETE, true);
return new _map<String, String>() {
@Override
protected String process(String objectId) {
if (isFolder(objectId)) {
return getBareFolder(objectId).getPath();
} else {
// Ignore multiple paths
return getBareDocument(objectId).getPaths().get(0);
}
}
}.on(failed);
}
示例12: deleteTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public FailedToDeleteData deleteTree(String repositoryId, String folderId,
Boolean allVersions, UnfileObject unfileObjects,
Boolean continueOnFailure, ExtensionsData extension) {
return getRepository().deleteTree(getCallContext(), folderId,
continueOnFailure);
}
示例13: deleteTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions, UnfileObject unfileObjects,
Boolean continueOnFailure, ExtensionsData extension) {
log.debug("deleteTree({}, {}, {})", new Object[]{repositoryId, folderId, allVersions});
return getRepository().deleteTree(getCallContext(), folderId, continueOnFailure);
}
示例14: deleteTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
return getRepository().deleteTree(getCallContext(), folderId, continueOnFailure);
}
示例15: deleteTree
import org.apache.chemistry.opencmis.commons.enums.UnfileObject; //导入依赖的package包/类
@Override
public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
return gregRepository.deleteTree(folderId);
}