Код: Выделить всё
// Two absolute (i.e. scheme-bearing), hierarchical URIs that differ only in their
// paths.
URI u0 = URI.create("http://example.com");
assert u0.getPath().equals("");
URI u1 = URI.create("http://example.com/");
assert u1.getPath().equals("/");
// "...a new relative hierarchical URI is constructed...with a path
// component computed by removing this URI's [u0] path [""] from the beginning of
// the given URI's [u1] path ["/"]."
assert "".equals(u0.relativize(u1).getPath()); // surprising?
Я не уверен, как "удалить" "" из "начала" "
Код: Выделить всё
/Код: Выделить всё
/Подробнее здесь: https://stackoverflow.com/questions/797 ... ne-with-as
Мобильная версия