Class Source


  • public class Source
    extends java.lang.Object
    Represents the source for the logging configuration as an immutable object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
      private java.lang.String location  
      private java.net.URI uri  
    • Constructor Summary

      Constructors 
      Constructor Description
      Source​(java.io.File file)
      Constructs a new Source with the specified file.
      Source​(java.net.URI uri)
      Constructs a new Source from the specified URI.
      Source​(java.net.URI uri, long lastModified)
      Deprecated.
      Source​(java.net.URL url)
      Constructs a new Source from the specified URL.
      Source​(java.nio.file.Path path)
      Constructs a new Source from the specified Path.
      Source​(ConfigurationSource source)
      Constructs a Source from a ConfigurationSource.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.io.File getFile()
      Gets the file configuration source, or null if this configuration source is based on an URL or has neither a file nor an URL.
      java.lang.String getLocation()
      Gets a string describing the configuration source file or URI, or null if this configuration source has neither a file nor an URI.
      java.nio.file.Path getPath()
      Gets this source as a Path.
      java.net.URI getURI()
      Gets the configuration source URI, or null if this configuration source is based on a file or has neither a file nor an URI.
      java.net.URL getURL()
      Gets the configuration source URL.
      int hashCode()  
      private static java.lang.String normalize​(java.io.File file)  
      private static java.io.File toFile​(java.net.URI uri)  
      private static java.io.File toFile​(java.nio.file.Path path)  
      java.lang.String toString()  
      private static java.net.URI toURI​(java.net.URL url)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • file

        private final java.io.File file
      • uri

        private final java.net.URI uri
      • location

        private final java.lang.String location
    • Constructor Detail

      • Source

        public Source​(ConfigurationSource source)
        Constructs a Source from a ConfigurationSource.
        Parameters:
        source - The ConfigurationSource.
      • Source

        public Source​(java.io.File file)
        Constructs a new Source with the specified file. file.
        Parameters:
        file - the file where the input stream originated
      • Source

        public Source​(java.nio.file.Path path)
        Constructs a new Source from the specified Path.
        Parameters:
        path - the Path where the input stream originated
      • Source

        public Source​(java.net.URI uri)
        Constructs a new Source from the specified URI.
        Parameters:
        uri - the URI where the input stream originated
      • Source

        @Deprecated
        public Source​(java.net.URI uri,
                      long lastModified)
        Deprecated.
        Constructs a new Source from the specified URI.
        Parameters:
        uri - the URI where the input stream originated
        lastModified - Not used.
      • Source

        public Source​(java.net.URL url)
        Constructs a new Source from the specified URL.
        Parameters:
        url - the URL where the input stream originated
        Throws:
        java.lang.IllegalArgumentException - if this URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.
    • Method Detail

      • normalize

        private static java.lang.String normalize​(java.io.File file)
      • toFile

        private static java.io.File toFile​(java.nio.file.Path path)
      • toFile

        private static java.io.File toFile​(java.net.URI uri)
      • toURI

        private static java.net.URI toURI​(java.net.URL url)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getFile

        public java.io.File getFile()
        Gets the file configuration source, or null 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

        public java.lang.String getLocation()
        Gets a string describing the configuration source file or URI, or null if this configuration source has neither a file nor an URI.
        Returns:
        a string describing the configuration source file or URI, or null
      • getPath

        public java.nio.file.Path getPath()
        Gets this source as a Path.
        Returns:
        this source as a Path.
      • getURI

        public java.net.URI getURI()
        Gets the configuration source URI, or null 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

        public java.net.URL getURL()
        Gets the configuration source URL.
        Returns:
        the configuration source URI, or null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object