java.lang.Object
org.apache.jena.atlas.lib.IRILib
Operations related to IRIs.
The encoding operations are for Linked Data use, not network encoding - e.g. use
URLEncoder.encode(java.lang.String) or org.apache.http.client.utilsURLEncodedUtils
for encoding query string name/value pairs for the network.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsNonASCII(String string) static StringDecode a string that may have %-encoded sequences.static StringencodeFileURL(String string) Encode using the rules for a file: URL.static StringencodeNonASCII(String string) static StringencodeUriComponent(String string) Encode using the rules for a component (e.g.static StringencodeUriPath(String uri) Encode using the rules for a path (e.g.static StringencodeUriQueryFrag(String string) Encode using the rules for a query string or fragment (e.g.static StringfilenameToIRI(String fn) Create a string that is a IRI for the filename.static StringReturn a string that is an IRI for the filename.static StringIRIToFilename(String iri) Convert a file: IRI to a filename
-
Constructor Details
-
IRILib
public IRILib()
-
-
Method Details
-
fileToIRI
Return a string that is an IRI for the filename. -
filenameToIRI
Create a string that is a IRI for the filename.- The file name may already have
file:. - The file name may be relative.
- Encode using the rules for a path (e.g. ':' and'/' do not get encoded)
- Non-IRI characters get %-encoded.
- The file name may already have
-
IRIToFilename
Convert a file: IRI to a filename -
encodeUriComponent
Encode using the rules for a component (e.g. ':' and '/' get encoded) Apply to a name/value of a query string. Does not encode non-ASCII characters -
encodeUriQueryFrag
Encode using the rules for a query string or fragment (e.g. ':' and '/' do not encoded). It does not encode non-ASCII characters. '?' is not encoded - in RFC 3986, the first '?' triggers the query part but it is then a legal, character. -
encodeFileURL
Encode using the rules for a file: URL. Does not encode non-ASCII characters -
encodeUriPath
Encode using the rules for a path (e.g. ':' and '/' do not get encoded) -
encodeNonASCII
-
containsNonASCII
-
decodeHex
Decode a string that may have %-encoded sequences.This function will reverse
encodeNonASCII(String),encodeUriPath(String),encodeFileURL(String)andencodeUriComponent(String). It will not decode '+' used for space (application/x-www-form-urlencoded).
-