Class Uris


  • public final class Uris
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Logger LOGGER  
    • 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)
      Reads URI specs of scheme classpath and file.
      static java.lang.String readUri​(java.net.URI uri, java.nio.charset.Charset charset)
      Reads URIs of scheme classpath and file.
      private static java.lang.String unsafeReadUri​(java.net.URI uri, java.nio.charset.Charset charset)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final Logger LOGGER
    • Constructor Detail

      • Uris

        private Uris()
    • Method Detail

      • readUri

        public static java.lang.String readUri​(java.lang.String spec,
                                               java.nio.charset.Charset charset)
        Reads URI specs of scheme classpath and file.
        Parameters:
        spec - the URI spec, e.g., file:/holy/cow.txt or classpath:/holy/cat.txt
        charset - used Charset for decoding the file
      • readUri

        public static java.lang.String readUri​(java.net.URI uri,
                                               java.nio.charset.Charset charset)
        Reads URIs of scheme classpath and file.
        Parameters:
        uri - the URI, e.g., file:/holy/cow.txt or classpath:/holy/cat.txt
        charset - used Charset 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