Class Source
java.lang.Object
org.apache.logging.log4j.core.util.Source
Represents the source for the logging configuration as an immutable object.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newSourcewith the specified file.Constructs a newSourcefrom the specified URI.Deprecated.Constructs a newSourcefrom the specified URL.Constructs a newSourcefrom the specified Path.Source(ConfigurationSource source) Constructs a Source from a ConfigurationSource. -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable FilegetFile()Gets the file configuration source, ornullif this configuration source is based on an URL or has neither a file nor an URL.Gets a string describing the configuration source file or URI, ornullif this configuration source has neither a file nor an URI.getPath()Gets this source as a Path.getURI()Gets the configuration source URI, ornullif this configuration source is based on a file or has neither a file nor an URI.getURL()Gets the configuration source URL.inthashCode()toString()
-
Constructor Details
-
Source
Constructs a Source from a ConfigurationSource.- Parameters:
source- The ConfigurationSource.- Throws:
NullPointerException- ifsourceisnull.
-
Source
Constructs a newSourcewith the specified file. file.- Parameters:
file- the file where the input stream originated.- Throws:
NullPointerException- iffileisnull.
-
Source
Constructs a newSourcefrom the specified Path.- Parameters:
path- the Path where the input stream originated- Throws:
NullPointerException- ifpathisnull.
-
Source
Constructs a newSourcefrom the specified URI.- Parameters:
uri- the URI where the input stream originated- Throws:
NullPointerException- ifuriisnull.
-
Source
Deprecated.UseSource(URI).Constructs a newSourcefrom the specified URI.- Parameters:
uri- the URI where the input stream originatedignored- Not used.- Throws:
NullPointerException- ifuriisnull.
-
Source
Constructs a newSourcefrom the specified URL.- Parameters:
url- the URL where the input stream originated- Throws:
NullPointerException- if this URL isnull.IllegalArgumentException- if this URL is not formatted strictly according to RFC2396 and cannot be converted to a URI.
-
-
Method Details
-
equals
-
getFile
Gets the file configuration source, ornullif this configuration source is based on an URL or has neither a file nor an URL.- Returns:
- the configuration source file, or
null
-
getLocation
Gets a string describing the configuration source file or URI, ornullif this configuration source has neither a file nor an URI.- Returns:
- a string describing the configuration source file or URI, or
null
-
getPath
Gets this source as a Path.- Returns:
- this source as a Path.
-
getURI
Gets the configuration source URI, ornullif this configuration source is based on a file or has neither a file nor an URI.- Returns:
- the configuration source URI, or
null
-
getURL
Gets the configuration source URL.- Returns:
- the configuration source URI, or
null
-
hashCode
public int hashCode() -
toString
-
Source(URI).