public static File removeParent(File parent,File file){
  String absolutePath=file.getAbsolutePath();
  String parentAbsolutePath=parent.getAbsolutePath();
  String newPath=absolutePath.replace(parentAbsolutePath + "/","");
  return new File(newPath);
}

public static File removeParent ( File parent , File file ) { String absolutePath = file . getAbsolutePath ( ) ; String parentAbsolutePath = parent . getAbsolutePath ( ) ; String newPath = absolutePath . replace ( parentAbsolutePath + "/" , "" ) ; return new File ( newPath ) ; }
convert a file into a relative path from a given parent . this is useful if you want to write out the file name into that parent directory .
