Here you can find the source of getFileName(String name)
public static String getFileName(String name)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String getFileName(String name) { if (new File(name).exists()) { return name; }/*from ww w. jav a 2 s . c o m*/ if (System.getProperty("os.name").contains("Mac")) { try { String appBundle = (String) Class.forName("com.apple.eio.FileManager") .getMethod("getPathToApplicationBundle", (Class[]) null).invoke(null, (Object[]) null); if (new File(appBundle + "/Contents/Resources/Java/" + name).exists()) { return appBundle + "/Contents/Resources/Java/" + name; } } catch (Exception e) { //fail quietly } } return ""; } }