I'm pretty much new to HDFS and faced the following problem:
org.apache.hadoop.fs.Path
getAbsolutePath
String
toString
org.apache.hadoop.fs.Path should return the full path. Yeah the toString method has barely any documentation but it works like it should!
Perhaps this could work too:
Path p = fs.getFileStatus(new Path(".")).getPath();
URI(p.toString()).getPath();
Reference: http://lucene.472066.n3.nabble.com/Is-there-a-way-to-get-an-absolute-HDFS-path-td3820562.html