Top Description Inners Fields Constructors Methods
org.eclipse.jetty.util.resource

public Class AttributeNormalizer

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.net.URI, .URISyntaxException, .URL, java.nio.file.FileSystems, .Files, .Path, java.util.ArrayList, .Comparator, .List, java.util.regex.Matcher, .Pattern, java.util.stream.Stream, org.eclipse.jetty.util.StringUtil, .URIUtil, org.slf4j.Logger, .LoggerFactory

Normalize Attribute to String.

Replaces and expands:

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final Comparator<AttributeNormalizer.Attribute>
private final Resource
private static final Logger
private final List<AttributeNormalizer.PathAttribute>
private final List<AttributeNormalizer.URIAttribute>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addSystemProperty(String key, int weight)

public String
private String
expand(String prefix, String property, String suffix)

public String

Returns:

the string representation of the object, with expansion keys.
normalize
(Object
the object to normalize into a string
o
)

Normalize a URI, URL, or File reference by replacing known attributes with ${key} attributes.

protected String
protected String
public static Path
private static Path
public static URI
public static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__propertyPatternback to summary
private static final Pattern __propertyPattern
attrComparatorback to summary
private static final Comparator<AttributeNormalizer.Attribute> attrComparator
baseResourceback to summary
private final Resource baseResource
LOGback to summary
private static final Logger LOG
pathsback to summary
private final List<AttributeNormalizer.PathAttribute> paths
urisback to summary
private final List<AttributeNormalizer.URIAttribute> uris

Constructor Detail

AttributeNormalizerback to summary
public AttributeNormalizer(Resource baseResource)

Method Detail

addSystemPropertyback to summary
private void addSystemProperty(String key, int weight)
expandback to summary
public String expand(String str)
expandback to summary
private String expand(String prefix, String property, String suffix)
normalizeback to summary
public String normalize(Object o)

Normalize a URI, URL, or File reference by replacing known attributes with ${key} attributes.

Parameters
o:Object

the object to normalize into a string

Returns:String

the string representation of the object, with expansion keys.

normalizePathback to summary
protected String normalizePath(Path path)
normalizeUriback to summary
protected String normalizeUri(URI uri)
toCanonicalPathback to summary
public static Path toCanonicalPath(String path)
toCanonicalPathback to summary
private static Path toCanonicalPath(Path path)
toCanonicalURIback to summary
public static URI toCanonicalURI(URI uri)
toCanonicalURIback to summary
public static String toCanonicalURI(String uri)
org.eclipse.jetty.util.resource back to summary

private Class AttributeNormalizer.Attribute

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.util.resource.AttributeNormalizer.Attribute
Known Direct Subclasses
org.eclipse.jetty.util.resource.AttributeNormalizer.PathAttribute, org.eclipse.jetty.util.resource.AttributeNormalizer.URIAttribute

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final String
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
Attribute(String key, String value, int weight)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
pack-priv final String key
valueback to summary
pack-priv final String value
weightback to summary
pack-priv final int weight

Constructor Detail

Attributeback to summary
public Attribute(String key, String value, int weight)
org.eclipse.jetty.util.resource back to summary

private Class AttributeNormalizer.PathAttribute

extends Attribute
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final Path
Inherited from org.eclipse.jetty.util.resource.AttributeNormalizer.Attribute:
keyvalueweight

Constructor Summary

AccessConstructor and Description
public
PathAttribute(String key, Path path, int weight)

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

pathback to summary
public final Path path

Constructor Detail

PathAttributeback to summary
public PathAttribute(String key, Path path, int weight)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.util.resource back to summary

private Class AttributeNormalizer.URIAttribute

extends Attribute
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final URI
Inherited from org.eclipse.jetty.util.resource.AttributeNormalizer.Attribute:
keyvalueweight

Constructor Summary

AccessConstructor and Description
public
URIAttribute(String key, URI uri, int weight)

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

uriback to summary
public final URI uri

Constructor Detail

URIAttributeback to summary
public URIAttribute(String key, URI uri, int weight)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override