URI simplification in java -
i have several strings being combined make uri. want ensure resulting uri simple possible. example, given
str1 = "/dir1/dir2"; str2 = "./dir3/";
i want end "/dir1/dir2/dir3/"
not "/dir1/dir2/./dir3/"
.
is there java library performs kind of simplification?
jdk7 has path.normalize method removes redundant name elements path. contains path.resolve can used join 2 paths.
take @ java tutorial | path operations more information.
Comments
Post a Comment