List of usage examples for org.apache.hadoop.util Shell USER_NAME_COMMAND
String USER_NAME_COMMAND
To view the source code for org.apache.hadoop.util Shell USER_NAME_COMMAND.
Click Source Link
From source file:org.apache.hama.bsp.BSPJobClient.java
License:Apache License
protected static String getUnixUserName() throws IOException { String[] result = executeShellCommand(new String[] { Shell.USER_NAME_COMMAND }); if (result.length != 1) { throw new IOException( "Expect one token as the result of " + Shell.USER_NAME_COMMAND + ": " + toString(result)); }/*w w w . ja va2 s . co m*/ String fixResult = fixCygwinName(result[0]); return fixResult; }