本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例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) {
}
}
示例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);
}