Examples of URLFileName


Examples of org.apache.commons.vfs.provider.URLFileName

     */
    private void setDavResource(WebdavResource resource) throws Exception
    {
        redirectionResolved = false;

        final URLFileName name = (URLFileName) getName();

        if (resource == null)
        {
            // HttpURL url = new HttpURL(name.getHostName(), name.getPort(), name.getPath());
            String pathEncoded = name.getPathQueryEncoded(urlCharset);
            HttpURL url = new HttpURL(name.getUserName(), name.getPassword(), name.getHostName(), name.getPort());
            url.setEscapedPath(pathEncoded);
            resource = new WebdavResource(fileSystem.getClient())
            {
            };
            resource.setHttpURL(url, WebdavResource.NOACTION, 1);
        }

        this.resource = resource;

        // if (bCheckExists)
        {
            /* now fill the dav properties */
            String pathEncoded = name.getPathQueryEncoded(urlCharset);
            final OptionsMethod optionsMethod = new OptionsMethod(pathEncoded);
            try
            {
                optionsMethod.setFollowRedirects(true);
                final int status = fileSystem.getClient().executeMethod(optionsMethod);
View Full Code Here

Examples of org.apache.commons.vfs.provider.URLFileName

    protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException
    {
        if (name instanceof URLFileName)
        {
            URLFileName urlName = (URLFileName) getName();

            // TODO: charset
            return new URL(urlName.getURIEncoded(null));
        }
        return new URL(getName().getURI());
    }
View Full Code Here

Examples of org.apache.commons.vfs.provider.URLFileName

    protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException
    {
        if (name instanceof URLFileName)
        {
            URLFileName urlName = (URLFileName) getName();

            // TODO: charset
            return new URL(urlName.getURIEncoded(null));
        }
        return new URL(getName().getURI());
    }
View Full Code Here

Examples of org.apache.commons.vfs.provider.URLFileName

    protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException
    {
        String url;
        if (name instanceof URLFileName)
        {
            URLFileName urlName = (URLFileName) getName();

            // TODO: charset
            url = urlName.getURIEncoded(null);
        }
        else
        {
            url = getName().getURI();
        }
View Full Code Here

Examples of org.apache.commons.vfs.provider.URLFileName

    private void setDavResource(WebdavResource resource) throws Exception
    {
     
        redirectionResolved = false;

        final URLFileName name = (URLFileName) getName();

        if (resource == null)
        {
            // HttpURL url = new HttpURL(name.getHostName(), name.getPort(), name.getPath());
            String pathEncoded = name.getPathQueryEncoded(urlCharset);
            HttpURL url = new HttpURL(name.getUserName(), name.getPassword(), name.getHostName(), name.getPort());
            url.setEscapedPath(pathEncoded);
            resource = new WebdavResource(fileSystem.getClient())
            {
            };
            resource.setHttpURL(url, WebdavResource.NOACTION, 1);
        }

        this.resource = resource;

        // if (bCheckExists)
        {
            /* now fill the dav properties */
            String pathEncoded = name.getPathQueryEncoded(urlCharset);
           
           // We only execute the options method in order to
           // setAllowedMethods. Haven't looked to see how important doing that is.
           
           // Existence is determined separately (see existsTest).
View Full Code Here

Examples of org.apache.commons.vfs2.provider.URLFileName

    protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException
    {
        if (name instanceof URLFileName)
        {
            URLFileName urlName = (URLFileName) getName();

            // TODO: charset
            return new URL(urlName.getURIEncoded(null));
        }
        return new URL(getName().getURI());
    }
View Full Code Here

Examples of org.apache.commons.vfs2.provider.URLFileName

    protected FileObject[] doListChildrenResolved() throws Exception
    {
        PropFindMethod method = null;
        try
        {
            URLFileName name = (URLFileName) getName();
            if (isDirectory(name))
            {
                DavPropertyNameSet nameSet = new DavPropertyNameSet();
                nameSet.add(DavPropertyName.create(DavConstants.PROPERTY_DISPLAYNAME));
View Full Code Here

Examples of org.apache.commons.vfs2.provider.URLFileName

    protected Map<String, Object> doGetAttributes() throws Exception
    {
        final Map<String, Object> attributes = new HashMap<String, Object>();
        try
        {
            URLFileName fileName = (URLFileName) getName();
            DavPropertySet properties = getProperties(fileName, PropFindMethod.PROPFIND_ALL_PROP,
                    new DavPropertyNameSet(), false);
            @SuppressWarnings("unchecked") // iterator() is documented to return DavProperty instances
            Iterator<DavProperty> iter = properties.iterator();
            while (iter.hasNext())
View Full Code Here

Examples of org.apache.commons.vfs2.provider.URLFileName

    protected void doSetAttribute(final String attrName, final Object value)
        throws Exception
    {
        try
        {
            URLFileName fileName = (URLFileName) getName();
            String urlStr = urlString(fileName);
            DavPropertySet properties = new DavPropertySet();
            DavPropertyNameSet propertyNameSet = new DavPropertyNameSet();
            DavProperty property = new DefaultDavProperty(attrName, value, Namespace.EMPTY_NAMESPACE);
            if (value != null)
View Full Code Here

Examples of org.apache.commons.vfs2.provider.URLFileName

        if (includeUserInfo)
        {
            user = name.getUserName();
            password = name.getPassword();
        }
        URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(),
                name.getDefaultPort(), user, password,
                name.getPath(), name.getType(), name.getQueryString());
        try
        {
            return newFile.getURIEncoded(urlCharset);
        }
        catch (Exception e)
        {
            return name.getURI();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.