Package org.jnode.command.util

Examples of org.jnode.command.util.AbstractDirectoryWalker$FileObject


        /**
     * Sets up a scratch folder for the test to use.
     */
    protected FileObject createScratchFolder() throws Exception
    {
        FileObject scratchFolder = getWriteFolder();

        // Make sure the test folder is empty
        scratchFolder.delete(Selectors.EXCLUDE_SELF);
        scratchFolder.createFolder();

        return scratchFolder;
    }
View Full Code Here


    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        // Locate the Jar file
        final File outerFile = AbstractVfsTestCase.getTestResource("nested.jar");
        final String uri = "jar:file:" + 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

    /**
     * Returns the base folder for tests.
     */
    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        final FileObject baseFolder = config.getBaseTestFolder(manager);

        // Create an empty file system, then link in the base folder
        final FileSystem newFs = manager.createVirtualFileSystem("vfs:").getFileSystem();
        final String junctionPoint = "/some/dir";
        newFs.addJunction(junctionPoint, baseFolder);
View Full Code Here

     */
    public void testAbsoluteFileName() throws Exception
    {
        // Locate file by absolute file name
        String fileName = new File("testdir").getAbsolutePath();
        FileObject absFile = getManager().resolveFile(fileName);

        // Locate file by URI
        String uri = "file://" + fileName.replace(File.separatorChar, '/');
        FileObject uriFile = getManager().resolveFile(uri);

        assertSame("file object", absFile, uriFile);
    }
View Full Code Here

     * Checks nested junctions are not supported.
     */
    public void testNestedJunction() throws Exception
    {
        final FileSystem fs = getManager().createVirtualFileSystem("vfs:").getFileSystem();
        final FileObject baseDir = getBaseDir();
        fs.addJunction("/a", baseDir);

        // Nested
        try
        {
View Full Code Here

     * Checks ancestors are created when a junction is created.
     */
    public void testAncestors() throws Exception
    {
        final FileSystem fs = getManager().createVirtualFileSystem("vfs://").getFileSystem();
        final FileObject baseDir = getBaseDir();

        // Make sure the file at the junction point and its ancestors do not exist
        FileObject file = fs.resolveFile("/a/b");
        assertFalse(file.exists());
        file = file.getParent();
        assertFalse(file.exists());
        file = file.getParent();
        assertFalse(file.exists());

        // Add the junction
        fs.addJunction("/a/b", baseDir);

        // Make sure the file at the junction point and its ancestors exist
        file = fs.resolveFile("/a/b");
        assertTrue("Does not exist", file.exists());
        file = file.getParent();
        assertTrue("Does not exist", file.exists());
        file = file.getParent();
        assertTrue("Does not exist", file.exists());
    }
View Full Code Here

     */
    @Override
    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        final File baseDir = AbstractVfsTestCase.getTestDirectoryFile();
        final FileObject baseFile = manager.toFileObject(baseDir);
        return manager.createVirtualFileSystem(baseFile);
    }
View Full Code Here

    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        // Locate the base Zip file
        final String zipFilePath = AbstractVfsTestCase.getTestResource("nested.zip").getAbsolutePath();
        String uri = "zip:file:" + zipFilePath + "!/test.zip";
        final FileObject zipFile = manager.resolveFile(uri);

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

    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        // Locate the base Tar file
        final String tarFilePath = AbstractVfsTestCase.getTestResource("nested.tgz").getAbsolutePath();
        String uri = "tgz:file:" + tarFilePath + "!/test.tgz";
        final FileObject tarFile = manager.resolveFile(uri);

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

    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        // Locate the base Tar file
        final String tarFilePath = AbstractVfsTestCase.getTestResource("nested.tbz2").getAbsolutePath();
        String uri = "tbz2:file:" + tarFilePath + "!/test.tbz2";
        final FileObject tarFile = manager.resolveFile(uri);

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

TOP

Related Classes of org.jnode.command.util.AbstractDirectoryWalker$FileObject

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.