Examples of FileName


Examples of org.apache.commons.vfs.FileName

        {
            if (rootFile == null)
            {
                rootFile = getContext().getTemporaryFileStore().allocateFile("tempfs");
            }
            final FileName rootName =
                getContext().parseURI(scheme + ":" + FileName.ROOT_PATH);
            // final FileName rootName =
            //    new LocalFileName(scheme, scheme + ":", FileName.ROOT_PATH);
            filesystem = new LocalFileSystem(rootName, rootFile.getAbsolutePath(), properties);
            addFileSystem(this, filesystem);
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 name =
            new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
        return new JarFileSystem(name, file, fileSystemOptions);
    }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

        throws FileSystemException
    {
        StringBuffer uri = new StringBuffer(name.length() + 5);
        uri.append("file:");
        uri.append(name);
        FileName filename = parseUri(null, uri.toString());
        return findFile(filename, null);
    }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

     */
    public void removeFile(final FileObject file)
    {
        synchronized (this.monitorMap)
        {
            FileName fn = file.getName();
            if (this.monitorMap.get(fn) != null)
            {
                FileObject parent;
                try
                {
View Full Code Here

Examples of org.apache.commons.vfs.FileName

                fileNames = this.monitorMap.keySet().toArray();
            }
            for (int iterFileNames = 0; iterFileNames < fileNames.length;
                 iterFileNames++)
            {
                FileName fileName = (FileName) fileNames[iterFileNames];
                FileMonitorAgent agent;
                synchronized (this.monitorMap)
                {
                    agent = (FileMonitorAgent) this.monitorMap.get(fileName);
                }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

     */
    protected FileObject createFile(final FileName name)
        throws Exception
    {
        // Find the file that the name points to
        final FileName junctionPoint = getJunctionForFile(name);
        final FileObject file;
        if (junctionPoint != null)
        {
            // Resolve the real file
            final FileObject junctionFile = (FileObject) junctions.get(junctionPoint);
            final String relName = junctionPoint.getRelativeName(name);
            file = junctionFile.resolveFile(relName, NameScope.DESCENDENT_OR_SELF);
        }
        else
        {
            file = null;
View Full Code Here

Examples of org.apache.commons.vfs.FileName

     */
    public void addJunction(final String junctionPoint,
                            final FileObject targetFile)
        throws FileSystemException
    {
        final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint);

        // Check for nested junction - these are not supported yet
        if (getJunctionForFile(junctionName) != null)
        {
            throw new FileSystemException("vfs.impl/nested-junction.error", junctionName);
        }

        try
        {
            // Add to junction table
            junctions.put(junctionName, targetFile);

            // Attach to file
            final DelegateFileObject junctionFile = (DelegateFileObject) getFileFromCache(junctionName);
            if (junctionFile != null)
            {
                junctionFile.setFile(targetFile);
            }

            // Create ancestors of junction point
            FileName childName = junctionName;
            boolean done = false;
            for (FileName parentName = childName.getParent();
                 !done && parentName != null;
                 childName = parentName, parentName = parentName.getParent())
            {
                DelegateFileObject file = (DelegateFileObject) getFileFromCache(parentName);
                if (file == null)
View Full Code Here

Examples of org.apache.commons.vfs.FileName

     * Removes a junction from this file system.
     */
    public void removeJunction(final String junctionPoint)
        throws FileSystemException
    {
        final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint);
        junctions.remove(junctionName);

        // TODO - remove from parents of junction point
        // TODO - detach all cached children of the junction point from their real file
    }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

        }

        // Find matching junction
        for (Iterator iterator = junctions.keySet().iterator(); iterator.hasNext();)
        {
            final FileName junctionPoint = (FileName) iterator.next();
            if (junctionPoint.isDescendent(name))
            {
                return junctionPoint;
            }
        }
View Full Code Here

Examples of org.apache.commons.vfs.FileName

     * Creates a virtual file system, with the supplied file as its root.
     */
    public FileObject createFileSystem(final FileObject rootFile)
        throws FileSystemException
    {
        final FileName rootName =
            getContext().getFileSystemManager().resolveName(rootFile.getName(), FileName.ROOT_PATH);
        // final FileName rootName =
        //    new BasicFileName(rootFile.getName(), FileName.ROOT_PATH);
        final VirtualFileSystem fs = new VirtualFileSystem(rootName, null);
        addComponent(fs);
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.