Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileObject.resolveFile()


        final String uri = "jar:" + outerFile.getAbsolutePath() + "!/test.jar";
        final FileObject jarFile = manager.resolveFile(uri);

        // Now build the nested file system
        final FileObject nestedFS = manager.createFileSystem(jarFile);
        return nestedFS.resolveFile("/");
    }
}
View Full Code Here


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

        // Resolve the file
        return rootFile.resolveFile(name.getPath());
    }

    /**
     * Creates a layered file system.
     */
 
View Full Code Here

        final FileObject src = mgr.resolveFile(cwd, cmd[1]);
        FileObject dest = mgr.resolveFile(cwd, cmd[2]);
        if (dest.exists() && dest.getType() == FileType.FOLDER)
        {
            dest = dest.resolveFile(src.getName().getBaseName());
        }

        dest.copyFrom(src, Selectors.SELECT_ALL);
    }
View Full Code Here

    public FileObject findFile(FileObject base, String name, FileSystemOptions properties) throws FileSystemException {
        //new Exception("findFile(" + base + ", " + name + ")").printStackTrace();
        try {
            URL location = FlexibleLocation.resolveLocation("ofbizhome://.");
            FileObject ofbizBase = getContext().resolveFile(location.toString(), properties);
            return VFSUtil.toFileObject(ofbizBase.getFileSystem().getFileSystemManager(), ofbizBase.resolveFile(name.substring(13)).getURL().toString(), properties);
        } catch (Exception e) {
            FileSystemException fse = new FileSystemException(e.getMessage(), null, e);
            fse.initCause(e);
            throw fse;
        }
View Full Code Here

            while (restStart < nameLength && name.charAt(restStart) == '/') restStart++;
            if (restStart == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
            String componentName = name.substring(componentNameStart, componentNameEnd);
            URL location = FlexibleLocation.resolveLocation("component://" + componentName + "/.");
            FileObject ofbizBase = getContext().resolveFile(location.toString(), properties);
            return VFSUtil.toFileObject(ofbizBase.getFileSystem().getFileSystemManager(), ofbizBase.resolveFile(name.substring(restStart)).getURL().toString(), properties);
        } catch (Exception e) {
            FileSystemException fse = new FileSystemException(e.getMessage(), null, e);
            fse.initCause(e);
            throw fse;
        }
View Full Code Here

    }

    @Test
    public void listGetRoot() throws Exception {
        FileObject rootFO = relativeToFO.getFileSystem().getRoot();
        rootFO = rootFO.resolveFile(irodsEncryptZone);

        //Note that in iRODS, there is no "/" directory
        //But there is /<zone>
        vfsTestHelp.doListTest(rootFO);
        String root = rootFO.getName().getPath();
View Full Code Here

            newFileCreation = this.createFileWithDummyContent(fo3, "c_.txt", content);
            if (assertContent) {
                this.assertSameContent(content, newFileCreation);
            }

            fo3.resolveFile("aNoContent.txt").createFile();
            fo3.resolveFile("bNoContent.txt").createFile();
            // create the folders
            fo3.resolveFile("a").createFolder();
            fo3.resolveFile("b").createFolder();
            FileObject aDir = fo3.resolveFile("a");
View Full Code Here

            if (assertContent) {
                this.assertSameContent(content, newFileCreation);
            }

            fo3.resolveFile("aNoContent.txt").createFile();
            fo3.resolveFile("bNoContent.txt").createFile();
            // create the folders
            fo3.resolveFile("a").createFolder();
            fo3.resolveFile("b").createFolder();
            FileObject aDir = fo3.resolveFile("a");
            FileObject bDir = fo3.resolveFile("b");
View Full Code Here

            }

            fo3.resolveFile("aNoContent.txt").createFile();
            fo3.resolveFile("bNoContent.txt").createFile();
            // create the folders
            fo3.resolveFile("a").createFolder();
            fo3.resolveFile("b").createFolder();
            FileObject aDir = fo3.resolveFile("a");
            FileObject bDir = fo3.resolveFile("b");

            // create files in sub folders
View Full Code Here

            fo3.resolveFile("aNoContent.txt").createFile();
            fo3.resolveFile("bNoContent.txt").createFile();
            // create the folders
            fo3.resolveFile("a").createFolder();
            fo3.resolveFile("b").createFolder();
            FileObject aDir = fo3.resolveFile("a");
            FileObject bDir = fo3.resolveFile("b");

            // create files in sub folders
            content = "d text can delete me";
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.