URI Normalization
In this chapter you will learn:
Normalization
Normalization is the process of removing unnecessary
".
" and "..
" path segments from a hierarchical
URI's path component.
URI declares a URI normalize()
method for normalizing a URI.
import java.net.URI;
import java.net.URISyntaxException;
// j a v a 2s . c om
public class Main {
public static void main(String[] args) throws URISyntaxException {
URI uri = new URI("http://java2s.com/./");
System.out.println("Normalized URI = " + uri.normalize());
}
}
Output:
Next chapter...
What you will learn in the next chapter:
Home » Java Tutorial » URL URI