public static String applyRelativePath(String path,String relativePath){
  int separatorIndex=path.lastIndexOf(FOLDER_SEPARATOR);
  if (separatorIndex != -1) {
    String newPath=path.substring(0,separatorIndex);
    if (!relativePath.startsWith(FOLDER_SEPARATOR)) {
      newPath+=FOLDER_SEPARATOR;
    }
    return newPath + relativePath;
  }
 else {
    return relativePath;
  }
}

public static String applyRelativePath ( String path , String relativePath ) { int separatorIndex = path . lastIndexOf ( FOLDER_SEPARATOR ) ; if ( separatorIndex != - 1 ) { String newPath = path . substring ( 0 , separatorIndex ) ; if ( ! relativePath . startsWith ( FOLDER_SEPARATOR ) ) { newPath += FOLDER_SEPARATOR ; } return newPath + relativePath ; } else { return relativePath ; } }
apply the given relative path to the given path , assuming standard java folder separation ( i . e . " / " separators ) .
