org.wso2.carbon.registry.core.Collection.getPath()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.wso2.carbon.registry.core.Collection.getPath()方法的一些代码示例,展示了Collection.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collection.getPath()方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Collection
类名称:Collection
方法名:getPath

Collection.getPath介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. public static String getTargetPathOfNode(RegistryFolder parentFolder, String name) {
  2. String parentPath = parentFolder.getNode().getPath();
  3. if (parentPath.endsWith("/")){
  4. return parentPath+name;
  5. } else {
  6. return parentPath + "/" + name;
  7. }
  8. }

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. /**
  2. * See CMIS 1.0 section 2.2.4.15 deleteTree
  3. *
  4. * In Greg, if we delete a collection it gets deleted. No worries.
  5. * Nothing will fail to delete.
  6. * TODO
  7. * Check whether checkedOut resources are deleted or not
  8. */
  9. public FailedToDeleteDataImpl deleteTree() {
  10. FailedToDeleteDataImpl result = new FailedToDeleteDataImpl();
  11. result.setIds(Collections.<String>emptyList());
  12. String id = getId();
  13. try {
  14. String path = getNode().getPath();
  15. getRepository().delete(path);
  16. } catch (RegistryException e) {
  17. log.error("Failed to delete the node with path " + getNode().getPath() , e);
  18. }
  19. return result;
  20. }

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. /**
  2. * See CMIS 1.0 section 2.2.4.14 deleteObject
  3. *
  4. * @throws CmisRuntimeException
  5. */
  6. @Override
  7. public void delete(boolean allVersions, boolean isPwc) {
  8. try {
  9. if (getNode().getChildCount()>0) {
  10. throw new CmisConstraintException("Folder is not empty!");
  11. } else {
  12. super.delete(allVersions, isPwc);
  13. }
  14. }
  15. catch (RegistryException e) {
  16. String msg = "Failed to delete the object " + getNode().getPath();
  17. log.error(msg, e);
  18. throw new CmisRuntimeException(msg, e);
  19. }
  20. }

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. addPropertyString(properties, typeId, filter, PropertyIds.PATH, getNode().getPath());
  2. addPropertyId(properties, typeId, filter, PropertyIds.PARENT_ID, CMISConstants.GREG_PROPERTY_NOT_SET);
  3. } else{
  4. addPropertyId(properties, typeId, filter, PropertyIds.PARENT_ID, getNode().getPath());

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. /**
  2. * See CMIS 1.0 section 2.2.4.13 moveObject
  3. *
  4. * @throws CmisStorageException
  5. */
  6. public RegistryObject move(RegistryFolder parent) {
  7. try {
  8. // move it if target location is not same as source location
  9. //TODO
  10. String destPath = CommonUtil.getDestPathOfNode(parent.getNode().getPath(), getNodeName());
  11. String srcPath = resource.getPath();
  12. Resource newNode;
  13. if (srcPath.equals(destPath)) {
  14. newNode = resource;
  15. } else {
  16. repository.move(srcPath, destPath);
  17. newNode = repository.get(destPath);
  18. }
  19. return create(newNode);
  20. }
  21. catch (RegistryException e) {
  22. String msg = "Failed ot move the object ";
  23. log.error(msg, e);
  24. throw new CmisStorageException(msg, e);
  25. }
  26. }

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.user.mgt

  1. parent = (Collection) tenentRegistry.newCollection();
  2. parent.setProperty(UserMgtConstants.DISPLAY_NAME, "All Permissions");
  3. parent.setChildren(new String[]{regRoot.getPath(), appRoot.getPath()});

代码示例来源:origin: wso2/carbon-identity-framework

  1. parent = (Collection) tenentRegistry.newCollection();
  2. parent.setProperty(UserMgtConstants.DISPLAY_NAME, "All Permissions");
  3. parent.setChildren(new String[]{regRoot.getPath(), appRoot.getPath()});

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.user.mgt

  1. parent = (Collection) tenentRegistry.newCollection();
  2. parent.setProperty(UserMgtConstants.DISPLAY_NAME, "All Permissions");
  3. parent.setChildren(new String[]{regRoot.getPath(), appRoot.getPath()});

代码示例来源:origin: wso2/carbon-identity-framework

  1. parent = (Collection) tenentRegistry.newCollection();
  2. parent.setProperty(UserMgtConstants.DISPLAY_NAME, "All Permissions");
  3. parent.setChildren(new String[]{regRoot.getPath(), appRoot.getPath()});

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. @Override
  2. protected Set<Action> compileAllowableActions(Set<Action> aas) {
  3. Set<Action> result = super.compileAllowableActions(aas);
  4. setAction(result, Action.CAN_GET_DESCENDANTS, true);
  5. setAction(result, Action.CAN_GET_CHILDREN, true);
  6. setAction(result, Action.CAN_GET_FOLDER_PARENT, !pathManager.isRoot(getNode()));
  7. setAction(result, Action.CAN_GET_OBJECT_PARENTS, !pathManager.isRoot(getNode()));
  8. setAction(result, Action.CAN_GET_FOLDER_TREE, true);
  9. setAction(result, Action.CAN_CREATE_DOCUMENT, true);
  10. setAction(result, Action.CAN_CREATE_FOLDER, true);
  11. if(getNode().getPath().equals("/")) {
  12. setAction(result, Action.CAN_DELETE_TREE, false);
  13. } else {
  14. setAction(result, Action.CAN_DELETE_TREE, true);
  15. }
  16. return result;
  17. }

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

  1. /**
  2. * See CMIS 1.0 section 2.2.4.2 createDocumentFromSource
  3. *
  4. * @throws CmisStorageException
  5. */
  6. public RegistryObject addNodeFromSource(RegistryDocument source, Properties properties) {
  7. try {
  8. String filename = source.getNodeName();
  9. String destPath = getRepository().copy(source.getNode().getPath(), getNode().getPath() + "/" + filename);
  10. RegistryObject gregObject = create(getRepository().get(destPath));
  11. // overlay new properties
  12. if (properties != null && properties.getProperties() != null) {
  13. updateProperties(gregObject.getNode(), gregObject.getTypeId(), properties);
  14. }
  15. //session.save();
  16. return gregObject;
  17. }
  18. catch (RegistryException e) {
  19. String msg = "Failed to add the node " + source.getId();
  20. log.error(msg, e);
  21. throw new CmisStorageException(msg, e);
  22. }
  23. }

相关文章