public JavaFileObjectImpl getReadable(FileKey key) throws IOException { JavaFileObjectImpl<P> entry = entries.get(key); if (entry == null) { P file = fs.getPath(key.names); if (file != null && fs.isFile(file)) { entries.put(key, entry = new JavaFileObjectImpl<P>(location, key, fs, file)); } } return entry; }
public JavaFileObjectImpl getReadable(FileKey key) throws IOException { JavaFileObjectImpl<P> entry = entries.get(key); if (entry == null) { P file = fs.getPath(key.names); if (file != null && fs.isFile(file)) { entries.put(key, entry = new JavaFileObjectImpl<P>(location, key, fs, file)); } } return entry; }
public final Timestamped<Resource> getResource(Iterable<String> names) throws IOException { P path = getPath(names); if (path != null && isFile(path)) { return getResource(path); } else { return null; } }
public final Timestamped<Resource> getResource(Iterable<String> names) throws IOException { P path = getPath(names); if (path != null && isFile(path)) { return getResource(path); } else { return null; } }
private <D> int kind(P srcPath, ReadWriteFileSystem<D> dst, D dstPath) throws IOException { if (isDir(srcPath)) { if (dst.isDir(dstPath)) { return 1; } else if (dst.isFile(dstPath)) { return 2; } else { return 1; } } else if (isFile(srcPath)) { if (dst.isFile(dstPath)) { return 0; } else if (dst.isDir(dstPath)) { return 3; } else { return 0; } } else { return 4; } }
private <D> int kind(P srcPath, ReadWriteFileSystem<D> dst, D dstPath) throws IOException { if (isDir(srcPath)) { if (dst.isDir(dstPath)) { return 1; } else if (dst.isFile(dstPath)) { return 2; } else { return 1; } } else if (isFile(srcPath)) { if (dst.isFile(dstPath)) { return 0; } else if (dst.isDir(dstPath)) { return 3; } else { return 0; } } else { return 4; } }
assertFalse(fs.isFile(root)); assertEquals("", fs.getName(root)); Iterator<P> rootChildren = fs.getChildren(root); assertFalse(fs.isFile(compiler)); assertEquals("compiler", fs.getName(compiler)); Iterator<P> compilerChildren = fs.getChildren(compiler); assertFalse(fs.isFile(disk)); assertEquals("disk", fs.getName(disk)); Iterator<P> diskChildren = fs.getChildren(disk); assertTrue(fs.isFile(a)); assertEquals("A.java", fs.getName(a));
assertFalse(fs.isFile(root)); assertEquals("", fs.getName(root)); Iterator<P> rootChildren = fs.getChildren(root); assertFalse(fs.isFile(compiler)); assertEquals("compiler", fs.getName(compiler)); Iterator<P> compilerChildren = fs.getChildren(compiler); assertFalse(fs.isFile(disk)); assertEquals("disk", fs.getName(disk)); Iterator<P> diskChildren = fs.getChildren(disk); assertTrue(fs.isFile(a)); assertEquals("A.java", fs.getName(a));
assertTrue(fooChildren.contains(fooBarTxt)); assertEquals("bar.txt", fs.getName(fooBarTxt)); assertTrue(fs.isFile(fooBarTxt)); URL fooBarTxtURL = fs.getURL(fooBarTxt); String fooBarTxtContent = Tools.read(fooBarTxtURL);
assertTrue(fooChildren.contains(fooBarTxt)); assertEquals("bar.txt", fs.getName(fooBarTxt)); assertTrue(fs.isFile(fooBarTxt)); URL fooBarTxtURL = fs.getURL(fooBarTxt); String fooBarTxtContent = Tools.read(fooBarTxtURL);