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

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

本文整理了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

public static String getTargetPathOfNode(RegistryFolder parentFolder, String name) {
  String parentPath = parentFolder.getNode().getPath();
  if (parentPath.endsWith("/")){
    return parentPath+name;
  } else {
    return parentPath + "/" + name;
  }
}

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

/**
 * See CMIS 1.0 section 2.2.4.15 deleteTree
 * 
 * In Greg, if we delete a collection it gets deleted. No worries.
 * Nothing will fail to delete.
 * TODO
 *     Check whether checkedOut resources are deleted or not 
 */
public FailedToDeleteDataImpl deleteTree() {
  FailedToDeleteDataImpl result = new FailedToDeleteDataImpl();
  result.setIds(Collections.<String>emptyList());
  String id = getId();
  try {
    String path = getNode().getPath();
    getRepository().delete(path);
  } catch (RegistryException e) {
    log.error("Failed to delete the node with path " + getNode().getPath() , e);
  }
  return result;
}

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

/**
 * See CMIS 1.0 section 2.2.4.14 deleteObject
 *
 * @throws CmisRuntimeException
 */
@Override
public void delete(boolean allVersions, boolean isPwc) {
  try {
    if (getNode().getChildCount()>0) {
      throw new CmisConstraintException("Folder is not empty!");
    } else {
      super.delete(allVersions, isPwc);
    }
  }
  catch (RegistryException e) {
    String msg = "Failed to delete the object " + getNode().getPath();
    log.error(msg, e);
    throw new CmisRuntimeException(msg, e);
  }
}

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

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

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

/**
 * See CMIS 1.0 section 2.2.4.13 moveObject
 *
 * @throws CmisStorageException
 */
public RegistryObject move(RegistryFolder parent) {
  try {
    // move it if target location is not same as source location
    //TODO 
    String destPath = CommonUtil.getDestPathOfNode(parent.getNode().getPath(), getNodeName());
    String srcPath  = resource.getPath();
    Resource newNode;
    if (srcPath.equals(destPath)) {
      newNode = resource;
    } else {
      repository.move(srcPath, destPath);
      newNode = repository.get(destPath);
    }
    return create(newNode);
  }
  catch (RegistryException e) {
    String msg = "Failed ot move the object ";
    log.error(msg, e);
    throw new CmisStorageException(msg, e);
  }
}

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

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

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

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

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

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

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

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

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

@Override
protected Set<Action> compileAllowableActions(Set<Action> aas) {
  Set<Action> result = super.compileAllowableActions(aas);
  setAction(result, Action.CAN_GET_DESCENDANTS, true);
  setAction(result, Action.CAN_GET_CHILDREN, true);
  setAction(result, Action.CAN_GET_FOLDER_PARENT, !pathManager.isRoot(getNode()));
  setAction(result, Action.CAN_GET_OBJECT_PARENTS, !pathManager.isRoot(getNode()));
  setAction(result, Action.CAN_GET_FOLDER_TREE, true);
  setAction(result, Action.CAN_CREATE_DOCUMENT, true);
  setAction(result, Action.CAN_CREATE_FOLDER, true);
  if(getNode().getPath().equals("/")) {
    setAction(result, Action.CAN_DELETE_TREE, false);
  } else {
    setAction(result, Action.CAN_DELETE_TREE, true);
  }
  return result;
}

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

/**
 * See CMIS 1.0 section 2.2.4.2 createDocumentFromSource
 *
 * @throws CmisStorageException
 */
public RegistryObject addNodeFromSource(RegistryDocument source, Properties properties) {
  try {
    String filename = source.getNodeName();
    String destPath = getRepository().copy(source.getNode().getPath(), getNode().getPath() + "/" + filename);
    RegistryObject gregObject = create(getRepository().get(destPath));
    // overlay new properties
    if (properties != null && properties.getProperties() != null) {
      updateProperties(gregObject.getNode(), gregObject.getTypeId(), properties);
    }
    //session.save();
    return gregObject;
  }
  catch (RegistryException e) {
    String msg = "Failed to add the node " + source.getId();
    log.error(msg, e);
    throw new CmisStorageException(msg, e);
  }
}

相关文章