当前位置: 首页>>代码示例>>Java>>正文


Java UnfileObject类代码示例

本文整理汇总了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;
	}
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:21,代码来源:FileManagerCmisImpl.java

示例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();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:CMISTestSupport.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:AlfrescoCmisServiceImpl.java

示例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");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:15,代码来源:PublicApiClient.java

示例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);
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:13,代码来源:CMISSimpleNonVersionedDocumentService.java

示例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");
	}
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:15,代码来源:PublicApiClient.java

示例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;
}
 
开发者ID:AlfrescoBenchmark,项目名称:benchmark-cmis,代码行数:39,代码来源:DeleteFolder.java

示例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);
}
 
开发者ID:keensoft,项目名称:icearchiva,代码行数:9,代码来源:AtomBindingCMISClientImpl.java

示例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);
}
 
开发者ID:keensoft,项目名称:icearchiva,代码行数:8,代码来源:AtomBindingCMISClientImpl.java

示例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;
}
 
开发者ID:mediaworx,项目名称:opencms-intellijplugin,代码行数:35,代码来源:VfsAdapter.java

示例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);
}
 
开发者ID:federicamazza,项目名称:vaadin-cmis-browser,代码行数:21,代码来源:CmisClient.java

示例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);
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:8,代码来源:FileBridgeCmisService.java

示例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);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:7,代码来源:CmisServiceImpl.java

示例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);
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:6,代码来源:FileBridgeCmisService.java

示例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);
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:7,代码来源:CMISService.java


注:本文中的org.apache.chemistry.opencmis.commons.enums.UnfileObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。