DFSUtil { public static boolean isValidName(String src) { return DFSUtilClient.isValidName(src); } private  DFSUtil(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static boolean isValidNameForComponent(String component); static boolean isReservedPathComponent(String component); static String bytes2String(byte[] bytes); static String bytes2String(byte[] bytes, int offset, int length); static byte[] string2Bytes(String str); static String byteArray2PathString(final byte[][] components,
      final int offset, final int length); static String byteArray2PathString(byte[][] pathComponents); static String strings2PathString(String[] components); static String path2String(final Object path); static byte[][] getPathComponents(String path); static byte[][] bytes2byteArray(byte[] bytes, byte separator); static byte[][] bytes2byteArray(byte[] bytes, int len,
      byte separator); static String addKeySuffixes(String key, String... suffixes); static Map<String, InetSocketAddress> getRpcAddressesForNameserviceId(
      Configuration conf, String nsId, String defaultValue); static Set<String> getAllNnPrincipals(Configuration conf); static Set<String> getJournalNodeAddresses(
      Configuration conf); static Map<String, Map<String, InetSocketAddress>> getBackupNodeAddresses(
      Configuration conf); static Map<String, Map<String, InetSocketAddress>> getSecondaryNameNodeAddresses(
      Configuration conf); static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses(
      Configuration conf); static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddressesForCluster(Configuration conf); static Map<String, Map<String, InetSocketAddress>> getNNLifelineRpcAddressesForCluster(Configuration conf); static String getNamenodeLifelineAddr(final Configuration conf,
      String nsId, String nnId); static List<ConfiguredNNAddress> flattenAddressMap(
      Map<String, Map<String, InetSocketAddress>> map); static String addressMapToString(
      Map<String, Map<String, InetSocketAddress>> map); static String nnAddressesAsString(Configuration conf); static Collection<URI> getInternalNsRpcUris(Configuration conf); static String getNameServiceIdFromAddress(final Configuration conf, 
      final InetSocketAddress address, String... keys); static URI getInfoServer(InetSocketAddress namenodeAddr,
      Configuration conf, String scheme); static URI getInfoServerWithDefaultHost(String defaultHost,
      Configuration conf, final String scheme); static String getHttpClientScheme(Configuration conf); static void setGenericConf(Configuration conf,
      String nameserviceId, String nnId, String... keys); static int roundBytesToGB(long bytes); static String getNamenodeNameServiceId(Configuration conf); static String getBackupNameServiceId(Configuration conf); static String getSecondaryNameServiceId(Configuration conf); static InetSocketAddress getBindAddress(Configuration conf,
      String confKey, String defaultValue, String bindHostKey); static URI createUri(String scheme, InetSocketAddress address); static URI createUri(String scheme, String host, int port); static void addPBProtocol(Configuration conf, Class<?> protocol,
      BlockingService service, RPC.Server server); @Deprecated static void addPBProtocol(Configuration conf, Class<?> protocol,
      com.google.protobuf.BlockingService service, RPC.Server server); static String getNamenodeServiceAddr(final Configuration conf,
      String nsId, String nnId); static String getNamenodeWebAddr(final Configuration conf, String nsId,
      String nnId); static Map<String, InetSocketAddress> getWebAddressesForNameserviceId(
      Configuration conf, String nsId, String defaultValue); static String getOnlyNameServiceIdOrNull(Configuration conf); static boolean parseHelpArgument(String[] args,
      String helpDescription, PrintStream out, boolean printGenericCommandUsage); static float getInvalidateWorkPctPerIteration(Configuration conf); static int getReplWorkMultiplier(Configuration conf); static String getSpnegoKeytabKey(Configuration conf, String defaultKey); static HttpConfig.Policy getHttpPolicy(Configuration conf); static HttpServer2.Builder loadSslConfToHttpServerBuilder(HttpServer2.Builder builder,
      Configuration sslConf); static String dateToIso8601String(Date date); static String durationToString(long durationMs); static long parseRelativeTime(String relTime); static Configuration loadSslConfiguration(Configuration conf); static HttpServer2.Builder httpServerTemplateForNNAndJN(
      Configuration conf, final InetSocketAddress httpAddr,
      final InetSocketAddress httpsAddr, String name, String spnegoUserNameKey,
      String spnegoKeytabFileKey); static void assertAllResultsEqual(Collection<?> objects); static KeyProviderCryptoExtension createKeyProviderCryptoExtension(
      final Configuration conf); static DelegationTokenIdentifier decodeDelegationToken(
      final Token<DelegationTokenIdentifier> token); static void checkProtectedDescendants(
      FSDirectory fsd, INodesInPath iip); static EnumSet<HdfsFileStatus.Flags> getFlags(
      final boolean isEncrypted, final boolean isErasureCoded,
      boolean isSnapShottable, boolean hasAcl); static boolean isParentEntry(final String path, final String parent); static final Logger LOG; static final Options helpOptions; static final Option helpOpt; }
@Test (timeout=15000) public void testIsValidName() { assertFalse(DFSUtil.isValidName("/foo/../bar")); assertFalse(DFSUtil.isValidName("/foo/./bar")); assertFalse(DFSUtil.isValidName("/foo assertTrue(DFSUtil.isValidName("/")); assertTrue(DFSUtil.isValidName("/bar/")); assertFalse(DFSUtil.isValidName("/foo/:/bar")); assertFalse(DFSUtil.isValidName("/foo:bar")); }