import java.net.URI; import java.net.URISyntaxException; import java.io.File; publicclass RelativeEncoding { publicstaticvoid main(String[] args) { try {
URI one = new URI("Relative%20with%20spaces");
URI two = (new File("/tmp/dir with spaces/File with spaces")).toURI();
URI three = two.resolve(one); if (!three.getSchemeSpecificPart().equals(three.getPath())) thrownew RuntimeException("Bad encoding on URI.resolve");
} catch (URISyntaxException e) { thrownew RuntimeException("Unexpected exception: " + e);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.