public Path getPathInHar ( Path path ) { Path harPath = new Path ( path . toUri ( ) . getPath ( ) ) ; if ( archivePath . compareTo ( harPath ) == 0 ) return new Path ( Path . SEPARATOR ) ; Path tmp = new Path ( harPath . getName ( ) ) ; Path parent = harPath . getParent ( ) ; while ( ! ( parent . compareTo ( archivePath ) == 0 ) ) { if ( parent . toString ( ) . equals ( Path . SEPARATOR ) ) { tmp = null ; break ; } tmp = new Path ( parent . getName ( ) , tmp ) ; parent = parent . getParent ( ) ; } if ( tmp != null ) tmp = new Path ( Path . SEPARATOR , tmp ) ; return tmp ; }
this method returns the path inside the har filesystem . this is relative path inside the har filesystem .