I am trying to read the contents of a file using Java.nio.file.Paths class, my code looks like this
package com.test.json;
Path currentDir = Paths.get(".");
System.out.println(currentDir.toAbsolutePath());
It is giving me the path
/home/rohit/workspace/MapReduceExample/.
while the output should be
home/rohit/workspace/MapReduceExample/src/com/test/json/
It is ignoring the component of src folder and packages. Could someone please tell me what I am doing wrong?
I can't give absolute path because I need this code for a map-reduce path, I have to construct path in relative manner. So, my approach is to do
getCurrentDirectoryPath + filename