Package org.apache.commons.vfs2

Examples of org.apache.commons.vfs2.FileName


    // Create the temp file system if it does not exist
    // FileSystem filesystem = findFileSystem( this, (Properties) null);
    FileSystem filesystem = findFileSystem(this, properties);
    if (filesystem == null)
    {
      final FileName rootName =
          getContext().parseURI(scheme + ":" + FileName.ROOT_PATH);

      filesystem = new AppEngineLocalFileSystem(rootName, rootFile.getAbsolutePath(), properties);
      addFileSystem(this, filesystem);
    }
View Full Code Here


     * @throws FileSystemException if an error occurs.
     */
    public FileObject resolveFile(final String nameStr) throws FileSystemException
    {
        // Resolve the name, and create the file
        final FileName name = getFileSystemManager().resolveName(rootName, nameStr);
        return resolveFile(name);
    }
View Full Code Here

        Map<FileName, FileObject> files = getOrCreateFilesystemCache(file.getFileSystem());

        writeLock.lock();
        try
        {
            FileName name = file.getName();

            // System.err.println(">>> " + files.size() + " put:" + file.toString());
            if (files.containsKey(name))
            {
                return false;
View Full Code Here

    public FileObject findFile(final FileObject baseFile,
                               final String uri,
                               final FileSystemOptions fileSystemOptions) throws FileSystemException
    {
        // Parse the URI
        final FileName name;
        try
        {
            name = parseUri(baseFile != null ? baseFile.getName() : null, uri);
        }
        catch (FileSystemException exc)
View Full Code Here

     */
    protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        // Check in the cache for the file system
        final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH);

        FileSystem fs = getFileSystem(rootName, fileSystemOptions);

        // Locate the file
        // return fs.resolveFile(name.getPath());
View Full Code Here

     * find the root of the filesystem.
     * @return The root FileName.
     */
    public FileName getRoot()
    {
        FileName root = this;
        while (root.getParent() != null)
        {
            root = root.getParent();
        }

        return root;
    }
View Full Code Here

        // TODO - use a hashtable when there are a large number of children
        FileObject[] children = getChildren();
        for (int i = 0; i < children.length; i++)
        {
            // final FileObject child = children[i];
            final FileName child = children[i].getName();
            // TODO - use a comparator to compare names
            // if (child.getName().getBaseName().equals(name))
            if (child.getBaseName().equals(name))
            {
                return resolveFile(child);
            }
        }
        return null;
View Full Code Here

     * @return The FileObject.
     * @throws FileSystemException if an error occurs.
     */
    public FileObject resolveFile(final String path) throws FileSystemException
    {
        final FileName otherName = getFileSystem().getFileSystemManager().resolveName(name, path);
        return fs.resolveFile(otherName);
    }
View Full Code Here

     */
    private void notifyParent(FileName childName, FileType newType) throws Exception
    {
        if (parent == null)
        {
            FileName parentName = name.getParent();
            if (parentName != null)
            {
                // Locate the parent, if it is cached
                parent = fs.getFileFromCache(parentName);
            }
View Full Code Here

            final String path;
            synchronized (getFileSystem())
            {
                path = this.fileInfo.getLink();
            }
            FileName relativeTo = getName().getParent();
            if (relativeTo == null)
            {
                relativeTo = getName();
            }
            FileName linkDestinationName = getFileSystem().getFileSystemManager().resolveName(relativeTo, path);
            linkDestination = getFileSystem().resolveFile(linkDestinationName);
        }

        return linkDestination;
    }
View Full Code Here

TOP

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

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.