Here you can find the source of loadFile(String path)
public static File loadFile(String path)
//package com.java2s; //License from project: Apache License import java.io.File; import java.nio.file.*; public class Main { public static File loadFile(String path) { if (path == null) { path = "/"; }/* w w w.j a va2 s . com*/ File f = new File(path); if (f.exists()) { return f.getAbsoluteFile(); } if (!path.startsWith("/")) { path = "/" + path; } return new File(Paths.get("").toAbsolutePath().toString() + path.trim()); } }