Examples of FileName


Examples of org.apache.commons.vfs.FileName

        // 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

Examples of org.apache.commons.vfs.FileName

     *             absolute path, which is resolved relative to the file system
     *             that contains this file.
     */
    public FileObject resolveFile(final String path) throws FileSystemException
    {
        final FileName otherName = getFileSystem().getFileSystemManager().resolveName(name, path);
        return fs.resolveFile(otherName);
    }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

     */
    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 = (AbstractFileObject) fs.getFileFromCache(parentName);
            }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

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

        return root;
    }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

        {
            List strongRef = new ArrayList(100);
            TarEntry entry;
            while ((entry = getTarFile().getNextEntry()) != null)
            {
                FileName name = getFileSystemManager().resolveName(getRootName(), UriParser.encode(entry.getName()));

                // Create the file
                TarFileObject fileObj;
                if (entry.isDirectory() && getFileFromCache(name) != null)
                {
                    fileObj = (TarFileObject) getFileFromCache(name);
                    fileObj.setTarEntry(entry);
                    continue;
                }

                fileObj = createTarFileObject(name, entry);
                putFileToCache(fileObj);
                strongRef.add(fileObj);
                fileObj.holdObject(strongRef);

                // Make sure all ancestors exist
                // TODO - create these on demand
                TarFileObject parent = null;
                for (FileName parentName = name.getParent();
                     parentName != null;
                     fileObj = parent, parentName = parentName.getParent())
                {
                    // Locate the parent
                    parent = (TarFileObject) getFileFromCache(parentName);
View Full Code Here

Examples of org.apache.commons.vfs.FileName

    protected FileSystem doCreateFileSystem(final String scheme,
                                            final FileObject file,
                                            final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        final FileName rootName =
            new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
        return new TarFileSystem(rootName, file, fileSystemOptions);
    }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

        final LayeredFileName name = (LayeredFileName) parseUri(baseFile!=null?baseFile.getName():null, uri);

        // Make the URI canonical

        // Resolve the outer file name
        final FileName fileName = name.getOuterName();
        final FileObject file = getContext().resolveFile(baseFile, fileName.getURI(), properties);

        // Create the file system
        final FileObject rootFile = createFileSystem(name.getScheme(), file, properties);

        // Resolve the file
View Full Code Here

Examples of org.apache.commons.vfs.FileName

                                                    final FileObject file,
                                                    final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        // Check if cached
        final FileName rootName = file.getName();
        FileSystem fs = findFileSystem(rootName, null);
        if (fs == null)
        {
            // Create the file system
            fs = doCreateFileSystem(scheme, file, fileSystemOptions);
View Full Code Here

Examples of org.apache.commons.vfs.FileName

        // Extract the scheme
        final String scheme = UriParser.extractScheme(filename, name);

        // Extract the Layered file URI
        final String rootUriName = extractRootName(name);
        FileName rootUri = null;
        if (rootUriName != null)
        {
            rootUri = context.parseURI(rootUriName);
        }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

  {
    FileSystemManager mgr = VFS.getManager();

    FileObject root = mgr
        .resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
    FileName rootName = root.getName();
 
    testNames(mgr, rootName);

    testChildren(root);
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.