public List < Resource > list ( String path ) { try { final List < Resource > ret = new ArrayList <> ( ) ; Resource res = deploymentResourceManager . getResource ( path ) ; if ( res != null ) { for ( Resource child : res . list ( ) ) { ret . add ( new ServletResource ( this , child ) ) ; } } String p = path ; if ( p . startsWith ( "/" ) ) { p = p . substring ( 1 ) ; } if ( overlays != null ) { for ( VirtualFile overlay : overlays ) { VirtualFile child = overlay . getChild ( p ) ; if ( child . exists ( ) ) { VirtualFileResource vfsResource = new VirtualFileResource ( overlay . getPhysicalFile ( ) , child , path ) ; for ( Resource c : vfsResource . list ( ) ) { ret . add ( new ServletResource ( this , c ) ) ; } } } } return ret ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; //this method really should have thrown IOException } }
Lists all children of a particular path taking overlays into account