private void deleteFolder( final ITransaction transaction, final String path, final Hashtable<String, WebdavStatus> errorList,
                               final WebdavRequest req, final WebdavResponse resp )
        throws WebdavException
    {

        String[] children = _store.getChildrenNames( transaction, path );
        children = children == null ? new String[] {} : children;
        StoredObject so = null;
        for ( int i = children.length - 1; i >= 0; i-- )
        {
            children[i] = "/" + children[i];
            try
            {
                so = _store.getStoredObject( transaction, path + children[i] );
                if ( so.isResource() )
                {
                    _store.removeObject( transaction, path + children[i] );

                }
                else
                {
                    deleteFolder( transaction, path + children[i], errorList, req, resp );

                    _store.removeObject( transaction, path + children[i] );

                }
            }
            catch ( final AccessDeniedException e )
            {
                errorList.put( path + children[i], SC_FORBIDDEN );
            }
            catch ( final ObjectNotFoundException e )
            {
                errorList.put( path + children[i], SC_NOT_FOUND );
            }
            catch ( final WebdavException e )
            {
                errorList.put( path + children[i], SC_INTERNAL_SERVER_ERROR );
            }
        }
        so = null;

    }
private void deleteFolder ( final ITransaction transaction , final String path , final Hashtable < String , WebdavStatus > errorList , final WebdavRequest req , final WebdavResponse resp ) throws WebdavException { String [ ] children = _store . getChildrenNames ( transaction , path ) ; children = children == null ? new String [ ] { } : children ; StoredObject so = null ; for ( int i = children . length - 1 ; i >= 0 ; i -- ) { children [ i ] = "/" + children [ i ] ; try { so = _store . getStoredObject ( transaction , path + children [ i ] ) ; if ( so . isResource ( ) ) { _store . removeObject ( transaction , path + children [ i ] ) ; } else { deleteFolder ( transaction , path + children [ i ] , errorList , req , resp ) ; _store . removeObject ( transaction , path + children [ i ] ) ; } } catch ( final AccessDeniedException e ) { errorList . put ( path + children [ i ] , SC_FORBIDDEN ) ; } catch ( final ObjectNotFoundException e ) { errorList . put ( path + children [ i ] , SC_NOT_FOUND ) ; } catch ( final WebdavException e ) { errorList . put ( path + children [ i ] , SC_INTERNAL_SERVER_ERROR ) ; } } so = null ; }
helper method of deleteResource() deletes the folder and all of its
contents

@param transaction
indicates that the method is within the scope of a WebDAV
transaction
@param path
the folder to be deleted
@param errorList
all errors that ocurred
@param req
HttpServletRequest
@param resp
HttpServletResponse
@throws WebdavException
if an error in the underlying store occurs