data-url

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

License

License

Categories

Categories

Data
GroupId

GroupId

com.github.robtimus
ArtifactId

ArtifactId

data-url
Last Version

Last Version

2.0
Release Date

Release Date

Type

Type

jar
Description

Description

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

Project URL

https://robtimus.github.io/data-url/
Source Code Management

Source Code Management

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

Download data-url

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.robtimus/data-url/ -->
<dependency>
    <groupId>com.github.robtimus</groupId>
    <artifactId>data-url</artifactId>
    <version>2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.robtimus/data-url/
implementation 'com.github.robtimus:data-url:2.0'
// https://jarcasting.com/artifacts/com.github.robtimus/data-url/
implementation ("com.github.robtimus:data-url:2.0")
'com.github.robtimus:data-url:jar:2.0'
<dependency org="com.github.robtimus" name="data-url" rev="2.0">
  <artifact name="data-url" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.robtimus', module='data-url', version='2.0')
)
libraryDependencies += "com.github.robtimus" % "data-url" % "2.0"
[com.github.robtimus/data-url "2.0"]

Dependencies

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.7.0
org.hamcrest : hamcrest jar 2.2
org.mockito : mockito-core jar 3.5.13

Project Modules

There are no modules declared in this project.

data-url

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.

Versions

Version
2.0
1.0.1
1.0