public abstract class HeaderSource extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderSource.LiteralHeaderSource
A
HeaderSource built from a lincense header template literal. |
static class |
HeaderSource.UrlHeaderSource
A
HeaderSource loaded from a URL. |
| Constructor and Description |
|---|
HeaderSource(String content,
boolean inline) |
| Modifier and Type | Method and Description |
|---|---|
String |
getContent() |
abstract boolean |
isFromUrl(URL location)
Retuns
true if this HeaderSource was loaded from the URL given in the location parameter
or false otherwise. |
boolean |
isInline() |
static HeaderSource |
of(String headerPath,
String encoding,
ResourceFinder finder) |
static HeaderSource |
of(String inlineHeader,
String headerPath,
String encoding,
ResourceFinder finder)
Checking the params left to right, returns the first available
HeaderSource that can be created. |
protected final String content
public HeaderSource(String content, boolean inline)
public static HeaderSource of(String headerPath, String encoding, ResourceFinder finder)
public static HeaderSource of(String inlineHeader, String headerPath, String encoding, ResourceFinder finder)
HeaderSource that can be created. If
inlineHeader is not null returns a new HeaderSource.LiteralHeaderSource. Otherwise attempts to create a
new HeaderSource.UrlHeaderSource out of headerPath and encoding.inlineHeader - the text of a lincense header templateheaderPath - a path resolvable by the finderencoding - the encoding to use when readinf headerPathfinder - the ResourceFinder to use to resolve headerPathHeaderSourcepublic String getContent()
public boolean isInline()
true if this HeaderSource was created from a string rather by loading the bits from an
URL; false otherwisepublic abstract boolean isFromUrl(URL location)
true if this HeaderSource was loaded from the URL given in the location parameter
or false otherwise.location - the URL to tell if this HeaderSource was loaded from ittrue if this HeaderSource was loaded from the URL given in the location parameter
or false otherwiseCopyright © 2008–2016 Mycila. All rights reserved.