About Path normalize() in Java -


for following code, apath turns out d:\ ocpjp7\ nio2\ src\subpath.java. why programs element gone?

path apath = paths.get(" d:\\ ocpjp7\\ programs\\..\\ nio2\\ src\\.\\ subpath.java");  apath = apath.normalize(); 

because normalization replaced .. programs' parent directory.

so have nio2 sub-folder of ocpjp7.

similarly, . goes away it's redundant (indicates current directory within context).


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -