public static void main ( String args [ ] ) { String home = "/home/user1/content/myfolder" ; String file = "/home/user1/figures/fig.png" ; System . out . println ( "home = " + home ) ; System . out . println ( "file = " + file ) ; System . out . println ( "path = " + getRelativePath ( new File ( home ) , new File ( file ) ) ) ; }
test the function