API change to avoid use of URI at all (very slow in both android and
regular jdk).