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

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

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

Collection.getChildCount介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.mashup.javascript.hostobjects.registry

public int jsGet_childCount() throws CarbonException {
  try {
    return ((Collection)this.getResource()).getChildCount();
  } catch (RegistryException e) {
    throw new CarbonException("Error occurred while creating a new Resource.", e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.entitlement

Collection collection = (Collection) resource;
List<String> list = new ArrayList<String>();
if (collection.getChildCount() > 0) {
  searchString = searchString.replace("*", ".*");
  Pattern pattern = Pattern.compile(searchString, Pattern.CASE_INSENSITIVE);

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

Collection collection = (Collection) resource;
List<String> list = new ArrayList<String>();
if (collection.getChildCount() > 0) {
  searchString = searchString.replace("*", ".*");
  Pattern pattern = Pattern.compile(searchString, Pattern.CASE_INSENSITIVE);

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

Collection collection = (Collection) resource;
List<String> list = new ArrayList<String>();
if (collection.getChildCount() > 0) {
  searchString = searchString.replace("*", ".*");
  Pattern pattern = Pattern.compile(searchString, Pattern.CASE_INSENSITIVE);

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.lcm

public static String[] getLifecycleList(Registry registry) throws RegistryException{
  Collection collection;
  try {
    collection = (Collection)registry.get(getContextRoot());
  } catch (Exception e) {
    return null;
  }
  if (collection == null) {
    CollectionImpl lifeCycleCollection = new CollectionImpl();
    registry.put(getContextRoot(), lifeCycleCollection);
    return null;
  }
  else {
    if (collection.getChildCount() == 0) {
      return null;
    }
    String[] childrenList = collection.getChildren();
    String[] lifeCycleNameList = new String[collection.getChildCount()];
    for (int i = 0; i < childrenList.length; i++) {
      String path = childrenList[i];
      lifeCycleNameList[i] = path.substring(path.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);
    }
    return lifeCycleNameList;
  }
}

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

private void deleteRecursively(String path,Registry registry) throws RegistryException {
  Resource currentResource = registry.get(path);
  if((currentResource instanceof Collection) && ((Collection)currentResource).getChildCount() == 0 ){
    registry.delete(path);
    deleteRecursively(currentResource.getParentPath(),registry);
  }
}

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

private void deleteChildRecursively(String path,Registry registry) throws RegistryException {
    Resource currentResource = registry.get(path);

    if((currentResource instanceof Collection) && ((Collection)currentResource).getChildCount() == 0 ){
      String[] childPaths = ((Collection)currentResource).getChildren();
      for (String childPath : childPaths) {
        deleteChildRecursively(childPath,registry);
      }
      registry.delete(path);
    } else {
      registry.delete(path);
    }

  }
}

代码示例来源: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.appmgt/org.wso2.carbon.appmgt.impl

if (userRegistry != null) {
  Collection collection = userRegistry.executeQuery(latestAPIQueryPath, params);
  int resultSetSize = Math.min(limit, collection.getChildCount());
  String[] recentlyAddedAPIPaths = new String[resultSetSize];
  for (int i = 0; i < resultSetSize; i++) {

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.event.core

Collection subscriptionCollection = (Collection) userRegistry.get(resourcePath);
subscriptionsArray =
    new Subscription[subscriptionCollection.getChildCount()];

代码示例来源:origin: org.wso2.greg/org.wso2.carbon.governance.samples.shutterbug

if (uploadLimit * 2 < home.getChildCount()) {
  throw new RegistryException("You have reached the upload limit of " + uploadLimit);

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

String parentPath =  requestContext.getResource().getParentPath();
Resource currentResource = registry.get(requestContext.getResource().getPath());
if ((currentResource instanceof Collection) && ((Collection)currentResource).getChildCount() != 0 ){
  String[] childPaths = ((Collection)currentResource).getChildren();
  for (String childPath : childPaths) {

相关文章