Examples of FSEntry


Examples of org.jnode.fs.FSEntry

     */
    private FSDirectory getParentDirectoryEntry(String file) throws IOException {
        if (file == null) {
            return null;
        }
        final FSEntry dirEntry = getEntry(getParentPath(file));
        if (dirEntry == null) {
            return null;
        }
        if (!dirEntry.isDirectory()) {
            return null;
        }
        return dirEntry.getDirectory();
    }
View Full Code Here

Examples of org.jnode.fs.FSEntry

            return (idx >= 0) ? path.substring(idx + 1) : path;
        }
    }

    public long getTotalSpace(String path) throws IOException {
        final FSEntry entry = getEntry(path);
        long length = 0L;
        if (entry != null) {
            length = entry.getFileSystem().getTotalSpace();
        }
        return length;
    }
View Full Code Here

Examples of org.jnode.fs.FSEntry

        }
        return length;
    }

    public long getFreeSpace(String path) throws IOException {
        final FSEntry entry = getEntry(path);
        long length = 0L;
        if (entry != null) {
            length = entry.getFileSystem().getFreeSpace();
        }
        return length;
    }
View Full Code Here

Examples of org.jnode.fs.FSEntry

        }
        return length;
    }

    public long getUsableSpace(String path) throws IOException {
        final FSEntry entry = getEntry(path);
        long length = 0L;
        if (entry != null) {
            length = entry.getFileSystem().getUsableSpace();
        }
        return length;
    }
View Full Code Here

Examples of org.jnode.fs.FSEntry

    public static void listEntries(Iterator<? extends FSEntry> iterator) throws Exception {
        log.debug("<<< BEGIN listEntries >>>");
        int i = 0;
        log.debug("------- entries ------");
        while (iterator.hasNext()) {
            FSEntry entry = iterator.next();
            log.debug(i + ":" + entry);
            i++;
        }
        log.debug("--- End of entries ---");
        log.debug("<<< END listEntries >>>");
View Full Code Here

Examples of org.jnode.fs.FSEntry

    }

    public static List<String> getEntryNames(Iterator<? extends FSEntry> it) {
        List<String> names = new ArrayList<String>();
        while (it.hasNext()) {
            FSEntry entry = it.next();
            names.add((entry == null) ? null : entry.getName());
        }
        return names;
    }
View Full Code Here

Examples of org.jnode.fs.FSEntry

    public List<FSEntry> toList(boolean compacted) {
        ArrayList<FSEntry> entryList = new ArrayList<FSEntry>();

        int nbEntries = entryNames.size();
        for (int i = 0; i < nbEntries; i++) {
            FSEntry entry = get(i);
            if (!compacted || (compacted && (entry != null))) {
                entryList.add(entry);
            }
        }
View Full Code Here

Examples of org.jnode.fs.FSEntry

    }

    public FSEntry getEntry(String name) {
        // System.out.println("Search : " + name);
        name = name.trim();
        FSEntry entry;
        // try first as a long file name
        entry = longFileNameIndex.get(name);
        if (entry == null)
            return shortNameIndex.get(name.toUpperCase());
        else
View Full Code Here

Examples of org.jnode.fs.FSEntry

    protected FSFile prepareFile(FSTestConfig config) throws Exception {
        remountFS(config, false);

        final String fileName = "RWTest";
        FSEntry rootEntry = getFs().getRootEntry();
        FSEntry entry = rootEntry.getDirectory().addFile(fileName);
        FSFile file = entry.getFile();
        file.setLength(FILE_SIZE_IN_WORDS * 2);
        file.flush();
        assertSize("Bad file size", FILE_SIZE_IN_WORDS * 2, file.getLength());

        remountFS(config, getFs().isReadOnly());

        rootEntry = getFs().getRootEntry();
        entry = rootEntry.getDirectory().getEntry(fileName);
        file = entry.getFile();
        assertSize("Bad file size", FILE_SIZE_IN_WORDS * 2, file.getLength());

        return file;
    }
View Full Code Here

Examples of org.jnode.fs.FSEntry

    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"));

            FSDirectory gotRootDir = getFs().getRootEntry().getDirectory();
            //assertNotNull("rootDir not saved", gotRootDir);
            assertTrue("same ref (gotRootDir) after remount", gotRootDir == rootDir);

            FSEntry gotDir1 = gotRootDir.getEntry("dir1");
            //assertNotNull("dir1 not saved", gotDir1);
            assertTrue("same ref (gotDir1) after remount", gotDir1 == dir1);
            assertEquals("returned bad entry", dir1.getName(), gotDir1.getName());
        }
    }
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.