Here you can find the source of getRelativeFileFromReference(String ref, File metadataFile)
public static File getRelativeFileFromReference(String ref, File metadataFile) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static File getRelativeFileFromReference(String ref, File metadataFile) throws IOException { String parentFilePath = ""; if (metadataFile.getParentFile() != null) parentFilePath = metadataFile.getParentFile().getPath(); File file = new File(new File(parentFilePath, ref).getCanonicalFile().toString() .replace(new File("").getCanonicalFile().toString(), "")); return file; }//from ww w . j a v a 2s .c om }