Class Uris
- java.lang.Object
-
- org.apache.logging.log4j.layout.template.json.util.Uris
-
public final class Uris extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Uris()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
consumeReader(java.io.BufferedReader reader)
private static java.lang.String
readClassPathUri(java.net.URI uri, java.nio.charset.Charset charset)
private static java.lang.String
readFileUri(java.net.URI uri, java.nio.charset.Charset charset)
static java.lang.String
readUri(java.lang.String spec, java.nio.charset.Charset charset)
ReadsURI
specs of scheme classpath and file.static java.lang.String
readUri(java.net.URI uri, java.nio.charset.Charset charset)
ReadsURI
s of scheme classpath and file.private static java.lang.String
unsafeReadUri(java.net.URI uri, java.nio.charset.Charset charset)
-
-
-
Field Detail
-
LOGGER
private static final Logger LOGGER
-
-
Method Detail
-
readUri
public static java.lang.String readUri(java.lang.String spec, java.nio.charset.Charset charset)
ReadsURI
specs of scheme classpath and file.- Parameters:
spec
- theURI
spec, e.g., file:/holy/cow.txt or classpath:/holy/cat.txtcharset
- usedCharset
for decoding the file
-
readUri
public static java.lang.String readUri(java.net.URI uri, java.nio.charset.Charset charset)
ReadsURI
s of scheme classpath and file.- Parameters:
uri
- theURI
, e.g., file:/holy/cow.txt or classpath:/holy/cat.txtcharset
- usedCharset
for decoding the file
-
unsafeReadUri
private static java.lang.String unsafeReadUri(java.net.URI uri, java.nio.charset.Charset charset) throws java.lang.Exception
- Throws:
java.lang.Exception
-
readFileUri
private static java.lang.String readFileUri(java.net.URI uri, java.nio.charset.Charset charset) throws java.io.IOException
- Throws:
java.io.IOException
-
readClassPathUri
private static java.lang.String readClassPathUri(java.net.URI uri, java.nio.charset.Charset charset) throws java.io.IOException
- Throws:
java.io.IOException
-
consumeReader
private static java.lang.String consumeReader(java.io.BufferedReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
-