how to get the filepath from filename using java

‮.www‬lautturi.com
how to get the filepath from filename using java
/**
 * @author lautturi.com
 * Java example: Get the absolute path of file in java
 */

import java.util.*;
import java.nio.file.FileSystems;

public class Lautturi {

	public static void main(String[] args) {
		String absolutePath = FileSystems.getDefault()
				  .getPath("test.txt")
				  .normalize()
				  .toAbsolutePath()
				  .toString();
		System.out.println("absolutePath:"+absolutePath);
	}
}
Created Time:2017-09-06 12:00:09  Author:lautturi