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 newSource
with the specified file.Constructs a newSource
from the specified URI.Deprecated.Constructs a newSource
from the specified URL.Constructs a newSource
from the specified Path.Source
(ConfigurationSource source) Constructs a Source from a ConfigurationSource. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable File
getFile()
Gets the file configuration source, ornull
if 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, ornull
if this configuration source has neither a file nor an URI.getPath()
Gets this source as a Path.getURI()
Gets the configuration source URI, ornull
if this configuration source is based on a file or has neither a file nor an URI.getURL()
Gets the configuration source URL.int
hashCode()
toString()
-
Constructor Details
-
Source
Constructs a Source from a ConfigurationSource.- Parameters:
source
- The ConfigurationSource.- Throws:
NullPointerException
- ifsource
isnull
.
-
Source
Constructs a newSource
with the specified file. file.- Parameters:
file
- the file where the input stream originated.- Throws:
NullPointerException
- iffile
isnull
.
-
Source
Constructs a newSource
from the specified Path.- Parameters:
path
- the Path where the input stream originated- Throws:
NullPointerException
- ifpath
isnull
.
-
Source
Constructs a newSource
from the specified URI.- Parameters:
uri
- the URI where the input stream originated- Throws:
NullPointerException
- ifuri
isnull
.
-
Source
Deprecated.UseSource(URI)
.Constructs a newSource
from the specified URI.- Parameters:
uri
- the URI where the input stream originatedignored
- Not used.- Throws:
NullPointerException
- ifuri
isnull
.
-
Source
Constructs a newSource
from 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, ornull
if 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, ornull
if 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, ornull
if 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)
.