private String normalizePath ( File root , File file ) { String relativePath = file . getPath ( ) . substring ( root . getPath ( ) . length ( ) + 1 ) ; String path = relativePath . replaceAll ( "\\" + File . separator , "/" ) ; return path ; }
Returns the relative path of the given file with respect to the root directory with all file separators replaced by slashes .