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); } }
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);
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);
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);
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; } }
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); } }
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); } } }
/** * 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); } }
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++) {
Collection subscriptionCollection = (Collection) userRegistry.get(resourcePath); subscriptionsArray = new Subscription[subscriptionCollection.getChildCount()];
if (uploadLimit * 2 < home.getChildCount()) { throw new RegistryException("You have reached the upload limit of " + uploadLimit);
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) {