protected String getDirectoryPath ( File directory , File entry ) { String relativePath ; if ( entry . equals ( directory ) ) { relativePath = "/" ; } else { String filePath = entry . getAbsolutePath ( ) ; String directoryPath = directory . getAbsolutePath ( ) ; relativePath = filePath . substring ( directoryPath . length ( ) ) . replace ( File . separator , "/" ) ; } return relativePath ; }
Return the relative path of a file within a directory .