get file path java

Java
File file = new File("yourfileName");
String path = file.getAbsolutePath();
Source

Also in Java: