public void copy ( ILocator destination , String depth , boolean overwrite , Collection propertyNames ) throws DAVException { // Define the request context. IContext context = newContext ( ) ; context . setDepth ( depth ) ; context . setOverwrite ( overwrite ) ; // Set up the request body to specify which properties should be kept alive. Document document = newDocument ( ) ; PropertyBehavior propertyBehavior = PropertyBehavior . create ( document ) ; if ( propertyNames == null ) propertyBehavior . setIsKeepAllAlive ( true ) ; else { Iterator namesItr = propertyNames . iterator ( ) ; while ( namesItr . hasNext ( ) ) { QualifiedName name = ( QualifiedName ) namesItr . next ( ) ; String nameURI = name . getQualifier ( ) + "/" + name . getLocalName ( ) ; //$NON-NLS-1$ propertyBehavior . addProperty ( nameURI ) ; } // end-while } // end-if // Call the server to perform the copy. IResponse response = null ; try { response = davClient . copy ( locator , destination , context , document ) ; examineResponse ( response ) ; examineMultiStatusResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; } }
Make a copy of this resource and place it at the location specified by the given destination locator .