Package org.apache.commons.vfs2.provider

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


         */
        @Override
        protected void onClose() throws IOException
        {
            RequestEntity entity = new ByteArrayRequestEntity(((ByteArrayOutputStream) out).toByteArray());
            URLFileName fileName = (URLFileName) getName();
            String urlStr = urlString(fileName);
            if (builder.isVersioning(getFileSystem().getFileSystemOptions()))
            {
                DavPropertySet set = null;
                boolean fileExists = true;
View Full Code Here


    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

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

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

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

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

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

     * @param name The FileName.
     * @return The encoded URL String.
     */
    private String hrefString(final URLFileName name)
    {
        final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(),
                name.getDefaultPort(), null, null,
                name.getPath(), name.getType(), name.getQueryString());
        try
        {
            return newFile.getURIEncoded(this.getUrlCharset());
        }
        catch (final Exception e)
        {
            return name.getURI();
        }
View Full Code Here

        if (includeUserInfo)
        {
            user = name.getUserName();
            password = name.getPassword();
        }
        final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(),
                name.getDefaultPort(), user, password,
                name.getPath(), name.getType(), name.getQueryString());
        try
        {
            return newFile.getURIEncoded(this.getUrlCharset());
        }
        catch (final Exception e)
        {
            return name.getURI();
        }
View Full Code Here

         */
        @Override
        protected void onClose() throws IOException
        {
            final RequestEntity entity = new ByteArrayRequestEntity(((ByteArrayOutputStream) out).toByteArray());
            final URLFileName fileName = (URLFileName) getName();
            final String urlStr = toUrlString(fileName);
            if (builder.isVersioning(getFileSystem().getFileSystemOptions()))
            {
                DavPropertySet set = null;
                boolean fileExists = true;
View Full Code Here

     */
    @Override
    public void prepare(final DefaultFileSystemManager manager)
        throws Exception
    {
        manager.addProvider("http", new HttpFileProvider());
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs2.provider.URLFileName

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.