Here you can find the source of makeRelativePathAbsolute(String relativePath)
public static String makeRelativePathAbsolute(String relativePath)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String makeRelativePathAbsolute(String relativePath) { File f = new File(relativePath); String prefix = f.getAbsolutePath(); if (!prefix.endsWith(File.separator)) { prefix = prefix + File.separator; }/*from w ww . java 2 s .com*/ int lastSlash = prefix.lastIndexOf(File.separator); if (lastSlash != -1) { return prefix.substring(0, lastSlash + 1); } return null; } }