public DiskFileSystem(final File root, final Name path) { this(root, new FilterImpl(root, path)); }
@Override public void populateRoots(Set<File> roots) throws IOException { if (fs instanceof DiskFileSystem) { roots.add(((DiskFileSystem)fs).getRoot()); } }
@Override protected ReadWriteFileSystem<File> create() throws IOException { File root = File.createTempFile("juzu", "test"); assertTrue(root.delete()); assertTrue(root.mkdir()); root.deleteOnExit(); return new DiskFileSystem(root); }
@Test public void testFoo() throws Exception { File root = new File(System.getProperty("juzu.test.resources.path")); assertNotNull(root); assertNotNull(root.isDirectory()); // doTest(new DiskFileSystem(root, "compiler.disk"), root); }
assertEquals(root, fs.getRoot()); assertTrue(fs.isDir(root)); assertFalse(fs.isFile(root)); assertEquals("", fs.getName(root)); Iterator<P> rootChildren = fs.getChildren(root); assertTrue(rootChildren.hasNext()); P compiler = rootChildren.next(); assertFalse(rootChildren.hasNext()); assertTrue(fs.isDir(compiler)); assertFalse(fs.isFile(compiler)); assertEquals("compiler", fs.getName(compiler)); Iterator<P> compilerChildren = fs.getChildren(compiler); assertTrue(compilerChildren.hasNext()); P disk = compilerChildren.next(); assertFalse(compilerChildren.hasNext()); assertTrue(fs.isDir(disk)); assertFalse(fs.isFile(disk)); assertEquals("disk", fs.getName(disk)); Iterator<P> diskChildren = fs.getChildren(disk); assertTrue(diskChildren.hasNext()); P a = diskChildren.next(); assertFalse(diskChildren.hasNext()); assertFalse(fs.isDir(a)); assertTrue(fs.isFile(a)); assertEquals("A.java", fs.getName(a));
public static DiskFileSystem diskFS(Name packageName) { File root = new File(System.getProperty("juzu.test.resources.path")); return new DiskFileSystem(root, packageName); }
@Test public void testFoo() throws Exception { File root = new File(System.getProperty("juzu.test.resources.path")); assertNotNull(root); assertNotNull(root.isDirectory()); // doTest(new DiskFileSystem(root, "compiler.disk"), root); }
@Override protected ReadWriteFileSystem<File> create() throws IOException { File root = File.createTempFile("juzu", "test"); assertTrue(root.delete()); assertTrue(root.mkdir()); root.deleteOnExit(); return new DiskFileSystem(root); }
assertEquals(root, fs.getRoot()); assertTrue(fs.isDir(root)); assertFalse(fs.isFile(root)); assertEquals("", fs.getName(root)); Iterator<P> rootChildren = fs.getChildren(root); assertTrue(rootChildren.hasNext()); P compiler = rootChildren.next(); assertFalse(rootChildren.hasNext()); assertTrue(fs.isDir(compiler)); assertFalse(fs.isFile(compiler)); assertEquals("compiler", fs.getName(compiler)); Iterator<P> compilerChildren = fs.getChildren(compiler); assertTrue(compilerChildren.hasNext()); P disk = compilerChildren.next(); assertFalse(compilerChildren.hasNext()); assertTrue(fs.isDir(disk)); assertFalse(fs.isFile(disk)); assertEquals("disk", fs.getName(disk)); Iterator<P> diskChildren = fs.getChildren(disk); assertTrue(diskChildren.hasNext()); P a = diskChildren.next(); assertFalse(diskChildren.hasNext()); assertFalse(fs.isDir(a)); assertTrue(fs.isFile(a)); assertEquals("A.java", fs.getName(a));
public static DiskFileSystem diskFS(Name packageName) { File root = new File(System.getProperty("juzu.test.resources.path")); return new DiskFileSystem(root, packageName); }
public DiskFileSystem(final File root, final Name path) { this(root, new FilterImpl(root, path)); }
@Override public void populateRoots(Set<File> roots) throws IOException { if (fs instanceof DiskFileSystem) { roots.add(((DiskFileSystem)fs).getRoot()); } }
public static DiskFileSystem diskFS(String packageName) { File root = new File(System.getProperty("juzu.test.resources.path")); return new DiskFileSystem(root, packageName); }
public DiskFileSystem(final File root, final String path) { this(root, new FilterImpl(root, Name.parse(path))); }
@Override public void processAnnotationChange(ModuleMetaModel metaModel, AnnotationChange change) { ElementHandle<?> elt = change.getKey().getElement(); if (elt instanceof ElementHandle.Package) { ElementHandle.Package pkgElt = (ElementHandle.Package)elt; DiskFileSystem fs = metaModel.getProcessingContext().getSourcePath(pkgElt); if (fs != null) { metaModel.root = fs.getRoot(); } } super.processAnnotationChange(metaModel, change); }
public static DiskFileSystem diskFS(String packageName) { File root = new File(System.getProperty("juzu.test.resources.path")); return new DiskFileSystem(root, packageName); }
public void applyFilter(String path) { filter = new FilterImpl(root, Name.parse(path)); }
@Override public void processAnnotationChange(ModuleMetaModel metaModel, AnnotationChange change) { ElementHandle<?> elt = change.getKey().getElement(); if (elt instanceof ElementHandle.Package) { ElementHandle.Package pkgElt = (ElementHandle.Package)elt; DiskFileSystem fs = metaModel.getProcessingContext().getSourcePath(pkgElt); if (fs != null) { metaModel.root = fs.getRoot(); } } super.processAnnotationChange(metaModel, change); }
public void applyFilter(String path) { filter = new FilterImpl(root, Name.parse(path)); }
public DiskFileSystem(final File root, final String path) { this(root, new FilterImpl(root, Name.parse(path))); }