private static String findRelativePath(String filePath,String dirPath){
  String relPath;
  if (!dirPath.endsWith(File.separator)) {
    dirPath=dirPath + File.separator;
  }
  if (filePath.startsWith(dirPath)) {
    relPath=filePath.substring(dirPath.length());
  }
 else {
    relPath=filePath;
  }
  return relPath;
}

private static String findRelativePath ( String filePath , String dirPath ) { String relPath ; if ( ! dirPath . endsWith ( File . separator ) ) { dirPath = dirPath + File . separator ; } if ( filePath . startsWith ( dirPath ) ) { relPath = filePath . substring ( dirPath . length ( ) ) ; } else { relPath = filePath ; } return relPath ; }
determine the path to the file relative to the given directory path .
