Package org.jnode.fs

Examples of org.jnode.fs.FSDirectory.addDirectory()


        fs = new HfsPlusFileSystemType().create(device, false);
        fs.read();
        fs.createRootEntry();
        FSDirectory root = fs.getRootEntry().getDirectory();
        Assert.assertFalse("Must be empty", root.iterator().hasNext());
        root.addDirectory("test");
        fs.flush();
        fs.close();
        fs = new HfsPlusFileSystemType().create(device, false);
        fs.read();
        Assert.assertEquals(1, fs.getVolumeHeader().getFolderCount());
View Full Code Here


        FSDirectory directory = getParentDirectoryEntry(file);
        if (directory == null) {
            return false;
        }
        // Ok, add the dir
        entry = directory.addDirectory(getName(file));
        return true;
    }

    /**
     * Make a file
View Full Code Here

    public void testFSTree() throws IOException, Exception {
        if (!config.isReadOnly()) {
            setUp();

            FSDirectory rootDir = getFs().getRootEntry().getDirectory();
            FSEntry dir1 = rootDir.addDirectory("dir1");
            assertNotNull("dir1 not added", rootDir.getEntry("dir1"));

            /*FSEntry dir11=*/
            dir1.getDirectory().addDirectory("dir1.1");
            assertNotNull("dir11 not added", dir1.getDirectory().getEntry("dir1.1"));
View Full Code Here

            setUp();

            FSDirectory rootDir = getFs().getRootEntry().getDirectory();
            log.debug("### testFSTreeWithRemount: rootDir=\n" + FSUtils.toString(rootDir, true));

            FSEntry dir1 = rootDir.addDirectory(fileName);
            assertNotNull("'" + fileName + "' not added", rootDir.getEntry(fileName));

            log.debug("### testFSTreeWithRemount: before remountFS");
            remountFS(config, getFs().isReadOnly());
            log.debug("### testFSTreeWithRemount: after remountFS");
View Full Code Here

        log.debug("Root dir before testAddDirectory :");
        TestUtils.listEntries(rootDir.iterator());
        if (config.isReadOnly()) {
            try {
                rootDir.addDirectory(dirName);
                fail("addDirectory must fail in readOnly mode");
            } catch (ReadOnlyFileSystemException e) {
                // success
            }
            assertContainsOnly("must be empty", rootDir.iterator(), getEmptyDirNames(config, true));
View Full Code Here

                // success
            }
            assertContainsOnly("must be empty", rootDir.iterator(), getEmptyDirNames(config, true));
        } else {
            try {
                FSEntry entry = rootDir.addDirectory(dirName);
                // success
                log.debug("added directory entry=" + FSUtils.toString(entry, true));
            } catch (ReadOnlyFileSystemException e) {
                fail("addDirectory must succeed in read/write mode");
            }
View Full Code Here

                final String mountPath = "jnode";
                fSS.mount(mountPath, fs, null);
                log.info("Mounted " + type.getName() + " on " + mountPath);

                FSDirectory root_dir = fs.getRootEntry().getDirectory();
                root_dir.addDirectory("home");
                root_dir.addDirectory("tmp");
                // adding files to /jnode/lib/ required by thecore classes
                FSDirectory libDir = (FSDirectory) root_dir.addDirectory("lib");
                InputStream is = RAMFSPlugin.class.getResourceAsStream("flavormap.properties");
                if (is != null) {
View Full Code Here

                fSS.mount(mountPath, fs, null);
                log.info("Mounted " + type.getName() + " on " + mountPath);

                FSDirectory root_dir = fs.getRootEntry().getDirectory();
                root_dir.addDirectory("home");
                root_dir.addDirectory("tmp");
                // adding files to /jnode/lib/ required by thecore classes
                FSDirectory libDir = (FSDirectory) root_dir.addDirectory("lib");
                InputStream is = RAMFSPlugin.class.getResourceAsStream("flavormap.properties");
                if (is != null) {
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

            } catch (IOException ex) {
                // Ignore
                entry = null;
            }
            if (entry == null) {
                entry = dir.addDirectory(part);
            }
            dir = entry.getDirectory();
        }
        return dir;
    }
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.