drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/utils/webdav/WebDavClient.java
public boolean createResource(String resource, InputStream is, boolean overwrite) throws Exception {
        boolean res = true;
        if (!overwrite) {
            try {
                if (queryProperties(resource) != null) {
                    res = false;
                }
            } catch (WebDavException e) {
                if (e.getErrorCode() != IResponse.SC_NOT_FOUND) {
                    throw e;
                }
            }
        }
        IResponse response = null;
        try {
            if (res) {
                ILocator locator = WebDAVFactory.locatorFactory.newLocator(resource);
                response = client.put(locator, createContext(), is);
                if (response.getStatusCode() != IResponse.SC_OK
                   && response.getStatusCode() != IResponse.SC_CREATED) {
                    throw new WebDavException(response);
                }
            }
        } finally {
            if (response != null) {
                response.close();
            }
        }
        return res;
    }
public boolean createResource(String resource, InputStream is, boolean overwrite) throws Exception {
        boolean res = true;
        if (!overwrite) {
            try {
                if (queryProperties(resource) != null) {
                    res = false;
                }
            } catch (WebDavException e) {
                if (e.getErrorCode() != IResponse.SC_NOT_FOUND) {
                    throw e;
                }
            }
        }
        IResponse response = null;
        try {
            if (res) {
                ILocator locator = WebDAVFactory.locatorFactory.newLocator(resource);
                response = client.put(locator, createContext(), is);
                if (response.getStatusCode() != IResponse.SC_OK
                   && response.getStatusCode() != IResponse.SC_CREATED) {
                    throw new WebDavException(response);
                }
            }
        } finally {
            if (response != null) {
                response.close();
            }
        }
        return res;
    }
public boolean createResource ( String resource , InputStream is , boolean overwrite ) throws Exception { boolean res = true ; if ( ! overwrite ) { try { if ( queryProperties ( resource ) != null ) { res = false ; } } catch ( WebDavException e ) { if ( e . getErrorCode ( ) != IResponse . SC_NOT_FOUND ) { throw e ; } } } IResponse response = null ; try { if ( res ) { ILocator locator = WebDAVFactory . locatorFactory . newLocator ( resource ) ; response = client . put ( locator , createContext ( ) , is ) ; if ( response . getStatusCode ( ) != IResponse . SC_OK && response . getStatusCode ( ) != IResponse . SC_CREATED ) { throw new WebDavException ( response ) ; } } } finally { if ( response != null ) { response . close ( ) ; } } return res ; }
/*
(non-Javadoc)
@see org.guvnor.tools.utils.webdav.IWebDavClient#createResource(java.lang.String, java.io.InputStream, boolean)
/ * ( non - Javadoc )