Java tutorial
//package com.java2s; import java.io.*; public class Main { private static String getDirectory(String fileName) { File file = new File(fileName); return file.getAbsolutePath(); } }