public class SURT
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BEGIN_TRANSFORMED_AUTHORITY |
protected static char |
DOT |
protected static java.lang.String |
END_TRANSFORMED_AUTHORITY |
protected static java.lang.String |
TRANSFORMED_HOST_DELIM |
protected static java.lang.String |
URI_SPLITTER |
| Constructor and Description |
|---|
SURT() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
fromPlain(java.lang.String u)
Given a plain URI or hostname/hostname+path, give its SURT form.
|
static java.lang.String |
fromURI(java.lang.String s)
Utility method for creating the SURT form of the URI in the
given String.
|
static java.lang.String |
fromURI(java.lang.String s,
boolean preserveCase)
Utility method for creating the SURT form of the URI in the
given String.
|
static void |
main(java.lang.String[] args)
Allow class to be used as a command-line tool for converting
URL lists (or naked host or host/path fragments implied
to be HTTP URLs) to SURT form.
|
static java.lang.String |
prefixFromPlain(java.lang.String u)
Given a plain URI or hostname/hostname+path, deduce an implied SURT
prefix from it.
|
protected static char DOT
protected static java.lang.String BEGIN_TRANSFORMED_AUTHORITY
protected static java.lang.String TRANSFORMED_HOST_DELIM
protected static java.lang.String END_TRANSFORMED_AUTHORITY
protected static java.lang.String URI_SPLITTER
public static java.lang.String fromURI(java.lang.String s)
s - String URI to be converted to SURT formpublic static java.lang.String fromURI(java.lang.String s,
boolean preserveCase)
s - String URI to be converted to SURT formpreserveCase - whether original case should be preservedpublic static java.lang.String prefixFromPlain(java.lang.String u)
u - URI or almost-URI to considerpublic static java.lang.String fromPlain(java.lang.String u)
u - URI or almost-URI to considerpublic static void main(java.lang.String[] args)
throws java.io.IOException
args - cmd-line argumentsjava.io.IOExceptionCopyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.