URL registry

Extend a java process with multiple URLStreamHandlers. URLStreamHandler can be registered through the service provider pattern or programmatically. This jar can also be used as a maven extension to allow maven plugins to use URL schemes not handled by the JRE.

License

License

GroupId

GroupId

org.honton.chas.url
ArtifactId

ArtifactId

url-extension
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

URL registry
Extend a java process with multiple URLStreamHandlers. URLStreamHandler can be registered through the service provider pattern or programmatically. This jar can also be used as a maven extension to allow maven plugins to use URL schemes not handled by the JRE.
Project URL

Project URL

https://github.com/chonton/url-extension
Source Code Management

Source Code Management

https://github.com/chonton/url-extension

Download url-extension

How to add to project

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

Dependencies

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.8

test (2)

Group / Artifact Type Version
com.google.guava : guava jar 20.0
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

url-extension

Extend a java process with multiple URLStreamHandlers. URLStreamHandler can be registered through the service provider pattern or programmatically. This artifact provides support for a 'tcp' scheme.

This jar can also be used as a maven extension to allow maven plugins to use URL schemes not handled by the JRE.

Requirements

  • Minimum of Java 7

Maven Coordinates

To include url-extension as a dependency in your maven build, use the following fragment in your pom.

  <build>
    <dependencies>
      <dependency>
        <groupId>org.honton.chas.url</groupId>
        <artifactId>url-extension</artifactId>
        <version>0.0.1</version>
      </dependency>
    </dependencies>
  </build>

To include url-extension as an extension for plugins in your maven build, use the following fragment in your pom.

  <build>
    <extensions>
      <extension>
        <groupId>org.honton.chas.url</groupId>
        <artifactId>url-extension</artifactId>
        <version>0.0.1</version>
      </extension>
    </extensions>
  </build>

UrlExtension

To register a URLStreamHandlerFactory:

    UrlStreamHandlerRegistry registry;
    // ...
    registry.factory(new TcpUrlStreamHandlerFactory());

To add all URLStreamHandlerFactory(s) that implement the service provider pattern:

   UrlStreamHandlerRegistry registry = UrlStreamHandlerRegistry.register();

To package your URLStreamHandlerFactory as a service provider, provide a file named java.net.URLStreamFactory in the META-INF/services directory of the jar.
Each line of this file should contain the name of a class implementing java.net.URLStreamFactory which should be added to the registry. For example, the

org.honton.chas.url.extension.urlhandler.TcpUrlStreamHandlerFactory

Tcp scheme

The TcpUrlStreamHandler supports URLs with the following syntax: tcp://[[<localaddress>][:<localport>]@]<remoteaddress>:<remoteport>. The remote address and remote port values are required. The local address and local port values are optional.

Versions

Version
0.0.1