robtimus / data-url

Support for data URLs as specified in RFC 2397 (https://www.ietf.org/rfc/rfc2397.txt)

Home Page:https://robtimus.github.io/data-url/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

data-url

Maven Central Build Status Quality Gate Status Coverage Known Vulnerabilities

The data-url library adds support for the data protocol as specified in RFC 2397.

There are several ways to create data URLs. Most are described by the URL class.

  1. Make use of a shared URLStreamHandlerFactory set on the URL class. This must return an instance of Handler for the data protocol.
  2. Add package com.github.robtimus.net.protocol to system property java.protocol.handler.pkgs.
  3. Use this URL constructor, and provide an instance of Handler as the URLStreamHandler. The context argument can remain null.
    • It's ill-advised to use this constructor, because it does not ensure the data URL is correctly formatted.
  4. Use utility class DataURLs.

Note that class Handler is stateless, and therefore instances can be shared among multiple threads.

About

Support for data URLs as specified in RFC 2397 (https://www.ietf.org/rfc/rfc2397.txt)

https://robtimus.github.io/data-url/

License:Apache License 2.0


Languages

Language:Java 100.0%