public void setContent ( String contentType , InputStream input ) throws DAVException { IResponse response = null ; try { IContext context = newContext ( ) ; context . setContentType ( contentType ) ; response = davClient . put ( locator , context , input ) ; examineResponse ( response ) ; } catch ( IOException e ) { throw new SystemException ( e ) ; } finally { closeResponse ( response ) ; } }
Set the content of this resource to be the data stored in the given input stream . The type encoding is given in the content type argument and should be in the media format described by RFC2616 Sec 3 . 7 . The stream will automatically be closed after the data is consumed . If the resource does not exist it is created with the given content .