Package org.eclipse.webdav

Examples of org.eclipse.webdav.IContext


            URL proxyServerUrl = getProxyServerUrl(originServerUrl);
            if (proxyServerUrl == null && !matchesProxyServerException(originServerUrl)) {
                proxyServerUrl = getDefaultProxyServerUrl();
            }

            IContext context = webDAVFactory.newContext(request.getContext());

            IContext defaultContext = getContext(originServerUrl);
            if (defaultContext == null) {
                defaultContext = getDefaultContext();
            }

            if (defaultContext != null) {
                Enumeration e = defaultContext.keys();
                while (e.hasMoreElements()) {
                    String key = (String) e.nextElement();
                    context.put(key, defaultContext.get(key));
                }
            }

            if (authority != null) {
                authority.authorize(request, null, context, proxyServerUrl, true);
View Full Code Here


            // set the socket factory
            connection.setSocketFactory(socketFactory);

            // send the request header
            IContext responseHeader = null;
            if (expect100Continue && (contentLength > 0 && httpVersion > 0 || sendChunked)) {
                if (!"100-continue".equalsIgnoreCase(context.get("Expect"))) { //$NON-NLS-1$ //$NON-NLS-2$
                    connection.setRequestHeaderField("Expect", "100-continue"); //$NON-NLS-1$ //$NON-NLS-2$
                }
                responseHeader = readResponseHeader(connection);
View Full Code Here

            closed = false;
        }
    }

    private IContext readResponseHeader(HttpConnection httpConnection) throws IOException {
        IContext responseHeader = webDAVFactory.newContext();

        int position = 0;
        String fieldName = null;
        while ((fieldName = httpConnection.getResponseHeaderFieldName(position)) != null) {
            // TBD : Should combine multiple headers
            if (responseHeader.get(fieldName.toLowerCase()) == null)
                responseHeader.put(fieldName.toLowerCase(), httpConnection.getResponseHeaderFieldValue(position));
            ++position;
        }

        return responseHeader;
    }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.guvnor.tools.utils.webdav.IWebDavClient#createContext()
     */
    public IContext createContext() {
        IContext context = WebDAVFactory.contextFactory.newContext();
        // Need to make sure the USER-AGENT header is present for Guvnor
        context.put("USER-AGENT", "guvnor"); //$NON-NLS-1$ //$NON-NLS-2$
        return context;
    }
View Full Code Here

     * @see org.guvnor.tools.utils.webdav.IWebDavClient#listDirectory(java.lang.String)
     */
    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);
            }
View Full Code Here

     * @see org.guvnor.tools.utils.webdav.IWebDavClient#queryProperties(java.lang.String)
     */
    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

TOP

Related Classes of org.eclipse.webdav.IContext

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.