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


Java Folder.getPath方法代码示例

本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.Folder.getPath方法的典型用法代码示例。如果您正苦于以下问题:Java Folder.getPath方法的具体用法?Java Folder.getPath怎么用?Java Folder.getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.chemistry.opencmis.client.api.Folder的用法示例。


在下文中一共展示了Folder.getPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFolder

import org.apache.chemistry.opencmis.client.api.Folder; //导入方法依赖的package包/类
private Folder createFolder(String path) throws Exception {
    String[] subFolderNames = path.split("/");
    Folder folder = getCmisSession().getRootFolder();
    for (String subfolder : subFolderNames){
        String folderPath = folder.getPath();
        if (folder.getPath().equals("/")){
            folderPath = "";
        }
        try{
            folder = FileUtils.getFolder(folderPath + "/" + subfolder, getCmisSession());
            logger.debug("Parent folder already exists, new folder value is: " + folder.getPath());
        }
        catch (CmisObjectNotFoundException e){
            // The folder does not existe, we create it here
            folder = FileUtils.createFolder(folder, subfolder, null);
            logger.debug("New folder created, new folder value is: " + folder.getPath());
        }
    }
    return folder;
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:21,代码来源:CMISSimpleNonVersionedDocumentService.java

示例2: getPurgableUuidFolder

import org.apache.chemistry.opencmis.client.api.Folder; //导入方法依赖的package包/类
private Folder getPurgableUuidFolder(Session session, String uuid, Folder multitenantRootFolder, Integer nestingLevels, boolean createIfNotExists) {
	
	int from = 0;
	Folder parentFolder = multitenantRootFolder;
	for (int i = 0; i < nestingLevels; i++) {
		String folderName = uuid.substring(from, from + NESTING_FOLDERS_NAME_SIZE);
		parentFolder = getFolderByPath(session, folderName, parentFolder, createIfNotExists);
		from = from + NESTING_FOLDERS_NAME_SIZE;
	}
	
	Folder folder = getFolderByPath(session, CMISClient.PURGABLE_FOLDER_PREFIX + uuid, parentFolder, createIfNotExists); 
	if (folder == null) {
		throw new RuntimeException("Folder " + uuid + " not found on CMIS path " + multitenantRootFolder.getPath());
	}
	return folder;
	
}
 
开发者ID:keensoft,项目名称:icearchiva,代码行数:18,代码来源:AtomBindingCMISClientImpl.java

示例3: getUuidFolder

import org.apache.chemistry.opencmis.client.api.Folder; //导入方法依赖的package包/类
private Folder getUuidFolder(Session session, String uuid, Folder multitenantRootFolder, Integer nestingLevels, boolean createIfNotExists) {
	
	int from = 0;
	Folder parentFolder = multitenantRootFolder;
	for (int i = 0; i < nestingLevels; i++) {
		String folderName = uuid.substring(from, from + NESTING_FOLDERS_NAME_SIZE);
		parentFolder = getFolderByPath(session, folderName, parentFolder, createIfNotExists);
		from = from + NESTING_FOLDERS_NAME_SIZE;
	}
	
	Folder folder = getFolderByPath(session, uuid, parentFolder, createIfNotExists);
	if (folder == null) {
		throw new RuntimeException("Folder " + uuid + " not found on CMIS path " + multitenantRootFolder.getPath());
	}
	return folder;
	
}
 
开发者ID:keensoft,项目名称:icearchiva,代码行数:18,代码来源:AtomBindingCMISClientImpl.java

示例4: createFolder

import org.apache.chemistry.opencmis.client.api.Folder; //导入方法依赖的package包/类
public String createFolder(String parentPath, String name) {
    
	Folder parent = (Folder) session.getObjectByPath(parentPath);
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(PropertyIds.NAME, name);
    properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
    Folder folder = parent.createFolder(properties);
    logger.info("Folder path: " + folder.getPath());
    return folder.getPath();
}
 
开发者ID:kylefernandadams,项目名称:cmis-jmeter-test,代码行数:11,代码来源:CmisHelper.java

示例5: deleteExistingFile

import org.apache.chemistry.opencmis.client.api.Folder; //导入方法依赖的package包/类
private void deleteExistingFile(Folder destinationFolder, String name) {
  String path = destinationFolder.getPath() + "/" + name;

  try {
    Document document = (Document) _session.getObjectByPath(path);

    getLog().info("Deleting '" + path + "' before uploading new one.");

    document.deleteAllVersions();
  } catch (Exception ex) {
  }
}
 
开发者ID:Redpill-Linpro,项目名称:artifact-upload-maven-plugin,代码行数:13,代码来源:CmisUploadMojo.java

示例6: testCreateLots

import org.apache.chemistry.opencmis.client.api.Folder; //导入方法依赖的package包/类
public void testCreateLots() throws Exception
{
    Session session = getSession("admin", "admin");
    
    Folder root = session.getRootFolder();
    String folderNameBase = getRootFolderName();

    
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
    properties.put(PropertyIds.NAME, folderNameBase);
    
    Folder base = root.createFolder(properties);
    for(int i = 0; i < 10; i++)
    {
       AccessControlPrincipalDataImpl principal = new AccessControlPrincipalDataImpl(""+i+i+i);
       List<String> permissions = new ArrayList<String>(1);
       permissions.add(BasicPermissions.ALL);
       List<Ace> addAces = new ArrayList<Ace>(1);
       addAces.add(new AccessControlEntryImpl(principal, permissions));
       base.addAcl(addAces, AclPropagation.PROPAGATE);
    }
    
    
    Thread last = null;
    
    for(int i = 0; i < 10; i++)
    {
        Creator creator = new Creator(base.getPath(), i);
        Thread thread = new Thread(creator);
        thread.start();
        last = thread;
    }
    
    if(last != null)
    {
        last.join();
    }
  
    ItemIterable<QueryResult> result = session.query("select * from cmis:folder", false);
    assertTrue(result.getTotalNumItems() > 0);
    
    //result = session.query("select * from cmis:folder where cmis:name = '"+folderName+"'", false);
    //assertTrue(result.getTotalNumItems() > 0);
    
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:47,代码来源:CMISDataCreatorTest.java


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