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

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

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

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

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

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

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

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

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

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

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

  1. public static String[] getLifecycleList(Registry registry) throws RegistryException{
  2. Collection collection;
  3. try {
  4. collection = (Collection)registry.get(getContextRoot());
  5. } catch (Exception e) {
  6. return null;
  7. }
  8. if (collection == null) {
  9. CollectionImpl lifeCycleCollection = new CollectionImpl();
  10. registry.put(getContextRoot(), lifeCycleCollection);
  11. return null;
  12. }
  13. else {
  14. if (collection.getChildCount() == 0) {
  15. return null;
  16. }
  17. String[] childrenList = collection.getChildren();
  18. String[] lifeCycleNameList = new String[collection.getChildCount()];
  19. for (int i = 0; i < childrenList.length; i++) {
  20. String path = childrenList[i];
  21. lifeCycleNameList[i] = path.substring(path.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);
  22. }
  23. return lifeCycleNameList;
  24. }
  25. }

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

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

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

  1. private void deleteChildRecursively(String path,Registry registry) throws RegistryException {
  2. Resource currentResource = registry.get(path);
  3. if((currentResource instanceof Collection) && ((Collection)currentResource).getChildCount() == 0 ){
  4. String[] childPaths = ((Collection)currentResource).getChildren();
  5. for (String childPath : childPaths) {
  6. deleteChildRecursively(childPath,registry);
  7. }
  8. registry.delete(path);
  9. } else {
  10. registry.delete(path);
  11. }
  12. }
  13. }

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

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

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

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

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

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

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

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

相关文章