protected URLTable extractPropStats ( MultiStatus multiStatus ) throws IOException , MalformedElementException { // Construct a URLTable to return to the user. URLTable reply = new URLTable ( ) ; // For each response (resource). Enumeration responses = multiStatus . getResponses ( ) ; while ( responses . hasMoreElements ( ) ) { ResponseBody responseBody = ( ResponseBody ) responses . nextElement ( ) ; String href = responseBody . getHref ( ) ; // The href may be relative to the request URL. URL resourceURL = new URL ( new URL ( locator . getResourceURL ( ) ) , href ) ; Hashtable properties = new Hashtable ( ) ; reply . put ( resourceURL , properties ) ; // For each property status grouping. Enumeration propstats = responseBody . getPropStats ( ) ; while ( propstats . hasMoreElements ( ) ) { PropStat propstat = ( PropStat ) propstats . nextElement ( ) ; org . eclipse . webdav . dom . Status status = new org . eclipse . webdav . dom . Status ( propstat . getStatus ( ) ) ; // For each property with this status. Enumeration elements = propstat . getProp ( ) . getProperties ( ) ; while ( elements . hasMoreElements ( ) ) { Element element = ( Element ) elements . nextElement ( ) ; QualifiedName name = ElementEditor . getQualifiedName ( element ) ; // Add a property status object to the result set. PropertyStatus propertyStatus = new PropertyStatus ( element , status . getStatusCode ( ) , status . getStatusMessage ( ) ) ; properties . put ( name , propertyStatus ) ; } // end-while } // end-while } // end-while return reply ; }
Helper method to extract the property status response from a multi status reponse and populate a URLTable with the results .