Class URLUtils
java.lang.Object
org.w3c.epubcheck.util.url.URLUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic io.mola.galimatias.URLdocURL(io.mola.galimatias.URL url) static StringencodePath(String string) static StringgetDataURLType(io.mola.galimatias.URL url) Returns the MIME type of a `data:` URL.static booleanisAbsoluteURLString(String string) static booleanstatic booleanisRemote(io.mola.galimatias.URL test, io.mola.galimatias.URL local) Test if a URL is "remote" compared to a another URL.static booleanisSameOrigin(io.mola.galimatias.URL urlA, io.mola.galimatias.URL urlB) static io.mola.galimatias.URLnormalize(io.mola.galimatias.URL url) static FiletoFile(io.mola.galimatias.URL url) static StringtoFilePath(io.mola.galimatias.URL url) static io.mola.galimatias.URL
-
Constructor Details
-
URLUtils
public URLUtils()
-
-
Method Details
-
toURL
-
toFile
-
toFilePath
-
docURL
public static io.mola.galimatias.URL docURL(io.mola.galimatias.URL url) -
isSameOrigin
public static boolean isSameOrigin(io.mola.galimatias.URL urlA, io.mola.galimatias.URL urlB) -
isRemote
public static boolean isRemote(io.mola.galimatias.URL test, io.mola.galimatias.URL local) Test if a URL is "remote" compared to a another URL. A URL is considered remote if it is not same origin as the test URL **and** it is not a `data` URL. Note that this relation is not defined in the URL standard, but is useful in EPUB (to test for remote resources compared to container URLs).- Parameters:
test- the URL to testlocal- the URL it is tested against- Returns:
- `true` if and only if `test` is remote compared to `local`.
-
isAbsoluteURLString
-
isPathRelativeSchemeLessURLString
-
encodePath
-
decode
-
normalize
public static io.mola.galimatias.URL normalize(io.mola.galimatias.URL url) -
getDataURLType
Returns the MIME type of a `data:` URL.- Parameters:
url- a URL, can be `null`.- Returns:
- the MIME type declared in the data URL (can be an empty string), or `null` if `url` is not a data URL.
-