Package org.apache.commons.vfs2

Examples of org.apache.commons.vfs2.FileSystemException


        {
            name = parseUri(baseFile != null ? baseFile.getName() : null, uri);
        }
        catch (FileSystemException exc)
        {
            throw new FileSystemException("vfs.provider/invalid-absolute-uri.error", uri, exc);
        }

        // Locate the file
        return findFile(name, fileSystemOptions);
    }
View Full Code Here


        {
            return FileType.IMAGINARY;
        }
        else
        {
            throw new FileSystemException("vfs.provider.http/head.error", getName());
        }
    }
View Full Code Here

    protected long doGetLastModifiedTime() throws Exception
    {
        final Header header = method.getResponseHeader("last-modified");
        if (header == null)
        {
            throw new FileSystemException("vfs.provider.http/last-modified.error", getName());
        }
        return DateUtil.parseDate(header.getValue()).getTime();
    }
View Full Code Here

        {
            throw new FileNotFoundException(getName());
        }
        if (status != HttpURLConnection.HTTP_OK)
        {
            throw new FileSystemException("vfs.provider.http/get.error", getName());
        }

        return new HttpInputStream(getMethod);
    }
View Full Code Here

     */
    void addChild(RamFileData data) throws FileSystemException
    {
        if (!this.getType().hasChildren())
        {
            throw new FileSystemException(
                    "A child can only be added in a folder");
        }

        if (data == null)
        {
            throw new FileSystemException("No child can be null");
        }

        if (this.children.contains(data))
        {
            throw new FileSystemException("Child already exists. " + data);
        }

        this.children.add(data);
        updateLastModified();
    }
View Full Code Here

     */
    void removeChild(RamFileData data) throws FileSystemException
    {
        if (!this.getType().hasChildren())
        {
            throw new FileSystemException(
                    "A child can only be removed from a folder");
        }
        if (!this.children.contains(data))
        {
            throw new FileSystemException("Child not found. " + data);
        }
        this.children.remove(data);
        updateLastModified();
    }
View Full Code Here

            return;
        }

        if (pos < 0)
        {
            throw new FileSystemException("vfs.provider/random-access-invalid-position.error",
                new Object[]
                {
                    new Long(pos)
                });
        }
View Full Code Here

        fileObject.setupMethod(getMethod);
        getMethod.setRequestHeader("Range", "bytes=" + filePointer + "-");
        final int status = fileSystem.getClient().executeMethod(getMethod);
        if (status != HttpURLConnection.HTTP_PARTIAL && status != HttpURLConnection.HTTP_OK)
        {
            throw new FileSystemException("vfs.provider.http/get-range.error", new Object[]
            {
                fileObject.getName(),
                new Long(filePointer)
            });
        }

        mis = new HttpFileObject.HttpInputStream(getMethod);
        // If the range request was ignored
        if (status == HttpURLConnection.HTTP_OK)
        {
            long skipped = mis.skip(filePointer);
            if (skipped != filePointer)
            {
                throw new FileSystemException("vfs.provider.http/get-range.error", new Object[]
                {
                    fileObject.getName(),
                    new Long(filePointer)
                });
            }
View Full Code Here

    void delete(RamFileObject file) throws FileSystemException
    {
        // root is read only check
        if (file.getParent() == null)
        {
            throw new FileSystemException("unable to delete root");
        }

        // Remove reference from cache
        this.cache.remove(file.getName());
        // Notify the parent
View Full Code Here

    {
        final int b1 = is.read();
        final int b2 = is.read();
        if (b1 != 'B' || b2 != 'Z')
        {
            throw new FileSystemException("vfs.provider.compressedFile/not-a-compressedFile-file.error", name);
        }
        return new CBZip2InputStream(is);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs2.FileSystemException

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.