Class Source
java.lang.Object
org.apache.logging.log4j.core.util.Source
Represents the source for the logging configuration as an immutable object.
-
Field Summary
Fields -
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 TypeMethodDescriptionbooleangetFile()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()private static Stringprivate static Fileprivate static FiletoString()private static URI
-
Field Details
-
file
-
uri
-
location
-
-
Constructor Details
-
Source
Constructs a Source from a ConfigurationSource.- Parameters:
source- The ConfigurationSource.
-
Source
Constructs a newSourcewith the specified file. file.- Parameters:
file- the file where the input stream originated
-
Source
Constructs a newSourcefrom the specified Path.- Parameters:
path- the Path where the input stream originated
-
Source
Constructs a newSourcefrom the specified URI.- Parameters:
uri- the URI where the input stream originated
-
Source
Deprecated.UseSource(URI).Constructs a newSourcefrom the specified URI.- Parameters:
uri- the URI where the input stream originatedlastModified- Not used.
-
Source
Constructs a newSourcefrom the specified URL.- Parameters:
url- the URL where the input stream originated- Throws:
IllegalArgumentException- if this URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.
-
-
Method Details
-
normalize
-
toFile
-
toFile
-
toURI
-
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).