@Test public void testIsValidNameInvalidInBaseFs() throws Exception { AbstractFileSystem baseFs = Mockito.spy(fc.getDefaultFileSystem()); ChRootedFs chRootedFs = new ChRootedFs(baseFs, new Path("/chroot")); Mockito.doReturn(false).when(baseFs).isValidName(Mockito.anyString()); Assert.assertFalse(chRootedFs.isValidName("/test")); Mockito.verify(baseFs).isValidName("/chroot/test"); }
@Override public boolean isValidName(String src) { return myFs.isValidName(fullPath(new Path(src)).toUri().toString()); }
ChRootedFs extends AbstractFileSystem { @Override public boolean isValidName(String src) { return myFs.isValidName(fullPath(new Path(src)).toUri().toString()); } }
ChRootedFs extends AbstractFileSystem { @Override public boolean isValidName(String src) { return myFs.isValidName(fullPath(new Path(src)).toUri().toString()); } ChRootedFs(final AbstractFileSystem fs, final Path theRoot); }
ChRootedFs extends AbstractFileSystem { @Override public boolean isValidName(String src) { return myFs.isValidName(fullPath(new Path(src)).toUri().toString()); } ChRootedFs(final AbstractFileSystem fs, final Path theRoot); @Override boolean isValidName(String src); @Override URI getUri(); String stripOutRoot(final Path p); @Override Path getHomeDirectory(); @Override Path getInitialWorkingDirectory(); Path getResolvedQualifiedPath(final Path f); @Override FSDataOutputStream createInternal(final Path f,
      final EnumSet<CreateFlag> flag, final FsPermission absolutePermission,
      final int bufferSize, final short replication, final long blockSize,
      final Progressable progress, final ChecksumOpt checksumOpt,
      final boolean createParent); @Override boolean delete(final Path f, final boolean recursive); @Override BlockLocation[] getFileBlockLocations(final Path f, final long start,
      final long len); @Override FileChecksum getFileChecksum(final Path f); @Override FileStatus getFileStatus(final Path f); void access(Path path, FsAction mode); @Override FileStatus getFileLinkStatus(final Path f); @Override FsStatus getFsStatus(); @Override FsServerDefaults getServerDefaults(); @Override int getUriDefaultPort(); @Override FileStatus[] listStatus(final Path f); @Override void mkdir(final Path dir, final FsPermission permission,
      final boolean createParent); @Override FSDataInputStream open(final Path f, final int bufferSize); @Override void renameInternal(final Path src, final Path dst); @Override void renameInternal(final Path src, final Path dst, 
      final boolean overwrite); @Override void setOwner(final Path f, final String username,
      final String groupname); @Override void setPermission(final Path f, final FsPermission permission); @Override boolean setReplication(final Path f, final short replication); @Override void setTimes(final Path f, final long mtime, final long atime); @Override void modifyAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeDefaultAcl(Path path); @Override void removeAcl(Path path); @Override void setAcl(Path path, List<AclEntry> aclSpec); @Override AclStatus getAclStatus(Path path); @Override void setXAttr(Path path, String name, byte[] value,
                       EnumSet<XAttrSetFlag> flag); @Override byte[] getXAttr(Path path, String name); @Override Map<String, byte[]> getXAttrs(Path path); @Override Map<String, byte[]> getXAttrs(Path path, List<String> names); @Override List<String> listXAttrs(Path path); @Override void removeXAttr(Path path, String name); @Override void setVerifyChecksum(final boolean verifyChecksum); @Override boolean supportsSymlinks(); @Override void createSymlink(final Path target, final Path link,
      final boolean createParent); @Override Path getLinkTarget(final Path f); @Override List<Token<?>> getDelegationTokens(String renewer); }
ChRootedFs extends AbstractFileSystem { @Override public boolean isValidName(String src) { return myFs.isValidName(fullPath(new Path(src)).toUri().toString()); } ChRootedFs(final AbstractFileSystem fs, final Path theRoot); @Override boolean isValidName(String src); @Override URI getUri(); String stripOutRoot(final Path p); @Override Path getHomeDirectory(); @Override Path getInitialWorkingDirectory(); Path getResolvedQualifiedPath(final Path f); @Override FSDataOutputStream createInternal(final Path f,
      final EnumSet<CreateFlag> flag, final FsPermission absolutePermission,
      final int bufferSize, final short replication, final long blockSize,
      final Progressable progress, final ChecksumOpt checksumOpt,
      final boolean createParent); @Override boolean delete(final Path f, final boolean recursive); @Override BlockLocation[] getFileBlockLocations(final Path f, final long start,
      final long len); @Override FileChecksum getFileChecksum(final Path f); @Override FileStatus getFileStatus(final Path f); void access(Path path, FsAction mode); @Override FileStatus getFileLinkStatus(final Path f); @Override FsStatus getFsStatus(); @Override FsServerDefaults getServerDefaults(); @Override int getUriDefaultPort(); @Override FileStatus[] listStatus(final Path f); @Override void mkdir(final Path dir, final FsPermission permission,
      final boolean createParent); @Override FSDataInputStream open(final Path f, final int bufferSize); @Override void renameInternal(final Path src, final Path dst); @Override void renameInternal(final Path src, final Path dst, 
      final boolean overwrite); @Override void setOwner(final Path f, final String username,
      final String groupname); @Override void setPermission(final Path f, final FsPermission permission); @Override boolean setReplication(final Path f, final short replication); @Override void setTimes(final Path f, final long mtime, final long atime); @Override void modifyAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeAclEntries(Path path, List<AclEntry> aclSpec); @Override void removeDefaultAcl(Path path); @Override void removeAcl(Path path); @Override void setAcl(Path path, List<AclEntry> aclSpec); @Override AclStatus getAclStatus(Path path); @Override void setXAttr(Path path, String name, byte[] value,
                       EnumSet<XAttrSetFlag> flag); @Override byte[] getXAttr(Path path, String name); @Override Map<String, byte[]> getXAttrs(Path path); @Override Map<String, byte[]> getXAttrs(Path path, List<String> names); @Override List<String> listXAttrs(Path path); @Override void removeXAttr(Path path, String name); @Override void setVerifyChecksum(final boolean verifyChecksum); @Override boolean supportsSymlinks(); @Override void createSymlink(final Path target, final Path link,
      final boolean createParent); @Override Path getLinkTarget(final Path f); @Override List<Token<?>> getDelegationTokens(String renewer);  }