public List<CmsResource> getResourcesInFolder(String resourcename, CmsResourceFilter filter) throws CmsException {

        List<CmsResource> list = new ArrayList<CmsResource>();

        // read children existing in the VFS
        try {
            list.addAll(m_cms.getResourcesInFolder(resourcename, filter));
        } catch (CmsException ex) {
            //noop
        }

        // iterate through all wrappers and call "addResourcesToFolder" and add the results to the list
        List<I_CmsResourceWrapper> wrappers = getWrappers();
        Iterator<I_CmsResourceWrapper> iter1 = wrappers.iterator();
        while (iter1.hasNext()) {
            I_CmsResourceWrapper wrapper = iter1.next();
            List<CmsResource> added = wrapper.addResourcesToFolder(m_cms, resourcename, filter);
            if (added != null) {
                list.addAll(added);
            }
        }

        // create a new list to add all resources
        ArrayList<CmsResource> wrapped = new ArrayList<CmsResource>();

        // eventually wrap the found resources
        Iterator<CmsResource> iter2 = list.iterator();
        while (iter2.hasNext()) {
            CmsResource res = iter2.next();

            // correct the length of the content if an UTF-8 marker would be added later
            if (needUtf8Marker(res) && !startsWithUtf8Marker(res)) {
                CmsWrappedResource wrap = new CmsWrappedResource(res);
                wrap.setLength(res.getLength() + CmsResourceWrapperUtils.UTF8_MARKER.length);

                res = wrap.getResource();
            }

            // get resource type wrapper for the resource
            I_CmsResourceWrapper resWrapper = getResourceTypeWrapper(res);

            if (resWrapper != null) {

                // adds the wrapped resources
                wrapped.add(resWrapper.wrapResource(m_cms, res));
            } else {

                // add the resource unwrapped
                wrapped.add(res);
            }
        }

        // sort the wrapped list correctly
        Collections.sort(wrapped, I_CmsResource.COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST);

        return wrapped;
    }
public List < CmsResource > getResourcesInFolder ( String resourcename , CmsResourceFilter filter ) throws CmsException { List < CmsResource > list = new ArrayList < CmsResource > ( ) ; try { list . addAll ( m_cms . getResourcesInFolder ( resourcename , filter ) ) ; } catch ( CmsException ex ) { } List < I_CmsResourceWrapper > wrappers = getWrappers ( ) ; Iterator < I_CmsResourceWrapper > iter1 = wrappers . iterator ( ) ; while ( iter1 . hasNext ( ) ) { I_CmsResourceWrapper wrapper = iter1 . next ( ) ; List < CmsResource > added = wrapper . addResourcesToFolder ( m_cms , resourcename , filter ) ; if ( added != null ) { list . addAll ( added ) ; } } ArrayList < CmsResource > wrapped = new ArrayList < CmsResource > ( ) ; Iterator < CmsResource > iter2 = list . iterator ( ) ; while ( iter2 . hasNext ( ) ) { CmsResource res = iter2 . next ( ) ; if ( needUtf8Marker ( res ) && ! startsWithUtf8Marker ( res ) ) { CmsWrappedResource wrap = new CmsWrappedResource ( res ) ; wrap . setLength ( res . getLength ( ) + CmsResourceWrapperUtils . UTF8_MARKER . length ) ; res = wrap . getResource ( ) ; } I_CmsResourceWrapper resWrapper = getResourceTypeWrapper ( res ) ; if ( resWrapper != null ) { wrapped . add ( resWrapper . wrapResource ( m_cms , res ) ) ; } else { wrapped . add ( res ) ; } } Collections . sort ( wrapped , I_CmsResource . COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST ) ; return wrapped ; }
Returns all child resources of a resource, that is the resources
contained in a folder.<p>

First fetch all child resources from VFS by calling {@link CmsObject#getResourcesInFolder(String, CmsResourceFilter)}.
After that all resource wrapper are called {@link I_CmsResourceWrapper#addResourcesToFolder(CmsObject, String, CmsResourceFilter)}
to have the chance to add additional resources to those already existing. In that list every resource is given to
the appropriate resource wrapper ({@link I_CmsResourceWrapper#wrapResource(CmsObject, CmsResource)}) to have the
possibility to change the existing resources. The matching resource wrapper for a resource is found by a call to
{@link I_CmsResourceWrapper#isWrappedResource(CmsObject, CmsResource)}.<p>

@see I_CmsResourceWrapper#addResourcesToFolder(CmsObject, String, CmsResourceFilter)
@see CmsObject#getResourcesInFolder(String, CmsResourceFilter)

@param resourcename the full path of the resource to return the child resources for
@param filter the resource filter to use

@return a list of all child <code>{@link CmsResource}</code>s

@throws CmsException if something goes wrong