Package org.jnode.shell

Examples of org.jnode.shell.PathnamePattern.expand()


            globbedWordTokens.add(wordToken);
            return;
        }
        PathnamePattern pattern = PathnamePattern.compilePathPattern(word);
        // Expand using the current directory as the base for relative path patterns.
        LinkedList<String> paths = pattern.expand(new File("."));
        // If it doesn't match anything, a pattern 'expands' to itself.
        if (paths.isEmpty()) {
            globbedWordTokens.add(wordToken);
        } else {
            for (String path : paths) {
View Full Code Here


                    } else {
                        addFile(file);
                    }
                } else {
                    PathnamePattern pat = PathnamePattern.compilePathPattern(pattern);
                    List<String> list = pat.expand(new File("."));
                    for (String name : list) {
                        File file = new File(name);
                        if (file.isDirectory()) {
                            dirs.add(file);
                        } else {
View Full Code Here

    }
   
    @Test
    public void testExpand() {
        PathnamePattern pat = PathnamePattern.compilePathPattern("/tmp/*");
        LinkedList<String> list = pat.expand(new File("."));
        for (String path : list) {
            Assert.assertTrue(new File(path).exists());
        }
        pat = PathnamePattern.compilePathPattern("*");
        list = pat.expand(new File("."));
View Full Code Here

        LinkedList<String> list = pat.expand(new File("."));
        for (String path : list) {
            Assert.assertTrue(new File(path).exists());
        }
        pat = PathnamePattern.compilePathPattern("*");
        list = pat.expand(new File("."));
        for (String path : list) {
            Assert.assertTrue(new File(path).exists());
        }
    }
}
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.