public String getSpaceContents ( String spaceID , String storeID , String prefix , long maxResults , String marker ) throws ResourceException { Element spaceElem = new Element ( "space" ) ; spaceElem . setAttribute ( "id" , spaceID ) ; try { StorageProvider storage = storageProviderFactory . getStorageProvider ( storeID ) ; List < String > contents = storage . getSpaceContentsChunked ( spaceID , prefix , maxResults , marker ) ; if ( contents != null ) { for ( String contentItem : contents ) { Element contentElem = new Element ( "item" ) ; contentElem . setText ( contentItem ) ; spaceElem . addContent ( contentElem ) ; } } } catch ( NotFoundException e ) { throw new ResourceNotFoundException ( "build space XML for" , spaceID , e ) ; } catch ( Exception e ) { storageProviderFactory . expireStorageProvider ( storeID ) ; throw new ResourceException ( "build space XML for" , spaceID , e ) ; } Document doc = new Document ( spaceElem ) ; XMLOutputter xmlConverter = new XMLOutputter ( ) ; return xmlConverter . outputString ( doc ) ; }
Gets a listing of the contents of a space .