Here you can find the source of toFile(File currentDirectory, String file)
public static File toFile(File currentDirectory, String file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static File toFile(File currentDirectory, String file) { String f = file == null ? "" : file; if (f.startsWith("/")) { return new File(f); }// w ww. jav a 2s. c o m return new File(currentDirectory, f); } }