FileContext { public static FileContext getFileContext(final AbstractFileSystem defFS, final Configuration aConf) { return new FileContext(defFS, FsPermission.getUMask(aConf), aConf); } private  FileContext(final AbstractFileSystem defFs,
    final FsPermission theUmask, final Configuration aConf); static FileContext getFileContext(final AbstractFileSystem defFS,
                    final Configuration aConf); static FileContext getFileContext(); static FileContext getLocalFSFileContext(); static FileContext getFileContext(final URI defaultFsUri); static FileContext getFileContext(final URI defaultFsUri,
      final Configuration aConf); static FileContext getFileContext(final Configuration aConf); static FileContext getLocalFSFileContext(final Configuration aConf); @InterfaceAudience.Private @InterfaceStability.Unstable /* return type will change to AFS once HADOOP-6223 is completed */ AbstractFileSystem getDefaultFileSystem(); void setWorkingDirectory(final Path newWDir); Path getWorkingDirectory(); UserGroupInformation getUgi(); Path getHomeDirectory(); FsPermission getUMask(); void setUMask(final FsPermission newUmask); Path resolvePath(final Path f); Path makeQualified(final Path path); FSDataOutputStream create(final Path f,
      final EnumSet<CreateFlag> createFlag, Options.CreateOpts... opts); void mkdir(final Path dir, final FsPermission permission,
      final boolean createParent); boolean delete(final Path f, final boolean recursive); FSDataInputStream open(final Path f); FSDataInputStream open(final Path f, final int bufferSize); boolean truncate(final Path f, final long newLength); boolean setReplication(final Path f, final short replication); void rename(final Path src, final Path dst,
      final Options.Rename... options); void setPermission(final Path f, final FsPermission permission); void setOwner(final Path f, final String username,
      final String groupname); void setTimes(final Path f, final long mtime, final long atime); FileChecksum getFileChecksum(final Path f); void setVerifyChecksum(final boolean verifyChecksum, final Path f); FileStatus getFileStatus(final Path f); @InterfaceAudience.LimitedPrivate({"HDFS", "Hive"}) void access(final Path path, final FsAction mode); FileStatus getFileLinkStatus(final Path f); Path getLinkTarget(final Path f); @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"}) @InterfaceStability.Evolving BlockLocation[] getFileBlockLocations(final Path f, final long start,
      final long len); FsStatus getFsStatus(final Path f); @SuppressWarnings("deprecation") void createSymlink(final Path target, final Path link,
      final boolean createParent); RemoteIterator<FileStatus> listStatus(final Path f); RemoteIterator<Path> listCorruptFileBlocks(Path path); RemoteIterator<LocatedFileStatus> listLocatedStatus(
      final Path f); boolean deleteOnExit(Path f); Util util(); static Statistics getStatistics(URI uri); static void clearStatistics(); static void printStatistics(); static Map<URI, Statistics> getAllStatistics(); @InterfaceAudience.LimitedPrivate( { "HDFS", "MapReduce" }) List<Token<?>> getDelegationTokens(
      Path p, String renewer); void modifyAclEntries(final Path path, final List<AclEntry> aclSpec); void removeAclEntries(final Path path, final List<AclEntry> aclSpec); void removeDefaultAcl(Path path); void removeAcl(Path path); void setAcl(Path path, final List<AclEntry> aclSpec); AclStatus getAclStatus(Path path); void setXAttr(Path path, String name, byte[] value); void setXAttr(Path path, final String name, final byte[] value,
      final EnumSet<XAttrSetFlag> flag); byte[] getXAttr(Path path, final String name); Map<String, byte[]> getXAttrs(Path path); Map<String, byte[]> getXAttrs(Path path, final List<String> names); void removeXAttr(Path path, final String name); List<String> listXAttrs(Path path); final Path createSnapshot(Path path); Path createSnapshot(final Path path, final String snapshotName); void renameSnapshot(final Path path, final String snapshotOldName,
      final String snapshotNewName); void deleteSnapshot(final Path path, final String snapshotName); void setStoragePolicy(final Path path, final String policyName); BlockStoragePolicySpi getStoragePolicy(Path path); Collection<? extends BlockStoragePolicySpi> getAllStoragePolicies(); static final Log LOG; static final FsPermission DEFAULT_PERM; static final FsPermission DIR_DEFAULT_PERM; static final FsPermission FILE_DEFAULT_PERM; static final int SHUTDOWN_HOOK_PRIORITY; }
@Test public void testDefaultURIWithoutScheme() throws Exception { final Configuration conf = new Configuration(); conf.set(FileSystem.FS_DEFAULT_NAME_KEY, "/"); try { FileContext.getFileContext(conf); fail(UnsupportedFileSystemException.class + " not thrown!"); } catch (UnsupportedFileSystemException ufse) { LOG.info("Expected exception: ", ufse); } }