org.apache.hadoop.hdfs
Class DFSUtil

java.lang.Object
  extended by org.apache.hadoop.hdfs.DFSUtil

@InterfaceAudience.Private
public class DFSUtil
extends Object


Nested Class Summary
static class DFSUtil.ErrorSimulator
          Utility class to facilitate junit test error simulation.
 
Constructor Summary
DFSUtil()
           
 
Method Summary
static String bytes2String(byte[] bytes)
          Converts a byte array to a string using UTF8 encoding.
static boolean isValidName(String src)
          Whether the pathname is valid.
static void login(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey)
          If a keytab has been provided, login as that user.
static byte[] string2Bytes(String str)
          Converts a string to a byte array using UTF8 encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFSUtil

public DFSUtil()
Method Detail

isValidName

public static boolean isValidName(String src)
Whether the pathname is valid. Currently prohibits relative paths, and names which contain a ":" or "/"


login

public static void login(org.apache.hadoop.conf.Configuration conf,
                         String keytabFileKey,
                         String userNameKey)
                  throws IOException
If a keytab has been provided, login as that user.

Throws:
IOException

bytes2String

public static String bytes2String(byte[] bytes)
Converts a byte array to a string using UTF8 encoding.


string2Bytes

public static byte[] string2Bytes(String str)
Converts a string to a byte array using UTF8 encoding.



Copyright © 2009 The Apache Software Foundation