Package org.eclipse.webdav

Examples of org.eclipse.webdav.ILocator


    public Map<String, ResourceProperties> listDirectory(String path) throws Exception {
        IResponse response = null;
        try {
            IContext context = createContext();
            context.put("Depth", "1"); //$NON-NLS-1$ //$NON-NLS-2$
            ILocator locator = WebDAVFactory.locatorFactory.newLocator(path);
            response = client.propfind(locator, context, null);
            if (response.getStatusCode() != IResponse.SC_MULTI_STATUS) {
                throw new WebDavException(response);
            }
            Map<String, ResourceProperties> res =
View Full Code Here


    public ResourceProperties queryProperties(String resource) throws Exception {
        IResponse response = null;
        try {
            IContext context = createContext();
            context.put("Depth", "1"); //$NON-NLS-1$ //$NON-NLS-2$
            ILocator locator = WebDAVFactory.locatorFactory.newLocator(resource);
            response = client.propfind(locator, context, null);
            if (response.getStatusCode() != IResponse.SC_MULTI_STATUS
               && response.getStatusCode() != IResponse.SC_OK) {
                throw new WebDavException(response);
            }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.guvnor.tools.utils.webdav.IWebDavClient#getInputStream(java.lang.String)
     */
    public IResponse getResourceInputStream(String resource) throws Exception {
        ILocator locator = WebDAVFactory.locatorFactory.newLocator(resource);
        IResponse response = client.get(locator, createContext());
        if (response.getStatusCode() != IResponse.SC_OK) {
            throw new WebDavException(response);
        }
        return response;
View Full Code Here

            }
        }
        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);
                }
View Full Code Here

     * @see org.guvnor.tools.utils.webdav.IWebDavClient#putResource(java.lang.String, java.io.InputStream)
     */
    public void putResource(String resource, InputStream is) throws Exception {
        IResponse response = null;
        try {
            ILocator locator = WebDAVFactory.locatorFactory.newLocator(resource);
            response = client.put(locator, createContext(), is);
            if (response.getStatusCode() != IResponse.SC_OK
               && response.getStatusCode() != IResponse.SC_NO_CONTENT
               && response.getStatusCode() != IResponse.SC_CREATED) {
                throw new WebDavException(response);
View Full Code Here

     * @see org.guvnor.tools.utils.webdav.IWebDavClient#deleteResource(java.lang.String)
     */
    public void deleteResource(String resource) throws Exception {
        IResponse response = null;
        try {
            ILocator locator = WebDAVFactory.locatorFactory.newLocator(resource);
            response = client.delete(locator, createContext());
            if (response.getStatusCode() != IResponse.SC_NO_CONTENT
               && response.getStatusCode() != IResponse.SC_OK) {
                throw new WebDavException(response);
            }
View Full Code Here

    /**
     * Check out this resource. Returns a resource handle on the checked out
     * version selector, or the working resource if a version is checked out.
     */
    public AbstractResourceHandle checkOut() throws DAVException {
        ILocator locator = protectedCheckOut();
        return new ResourceHandle(davClient, locator);
    }
View Full Code Here

    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!(obj instanceof ILocator))
            return false;
        ILocator locator = (ILocator) obj;
        if (!resourceURL.equals(locator.getResourceURL()))
            return false;
        if (label == null)
            return locator.getLabel() == null;
        return label.equals(locator.getLabel());
    }
View Full Code Here

    /**
     * Check out this resource. Returns a resource handle on the checked out
     * version selector, or the working resource if a version is checked out.
     */
    public AbstractResourceHandle checkOut() throws DAVException {
        ILocator locator = protectedCheckOut();
        return new WorkspaceHandle(davClient, locator);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.webdav.ILocator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.