Class StreamUtils


  • public class StreamUtils
    extends Object
    INTERNAL: Utilities for working with streams and readers.
    Since:
    1.3.3
    • Constructor Detail

      • StreamUtils

        public StreamUtils()
    • Method Detail

      • getInputStream

        public static InputStream getInputStream​(File basedir,
                                                 String name)
                                          throws IOException
        INTERNAL: Returns an input stream for the given url. Supports file: and classpath:. If no scheme given then file system will be checked before classpath. Exception will be thrown if resource is not found when scheme is given. If no scheme was given null is returned. File references will be interpreted relative to basedir. If basedir is null, it will be ignored.
        Throws:
        IOException
        Since:
        5.1.1
      • getResource

        public static URL getResource​(String name)
                               throws IOException
        INTERNAL: Returns an input stream for the given url. Supports file: and classpath:. If no schema given then file system will be checked before classpath. Exception will be thrown if resource is not found when schema is given. If no schema was given null is returned.
        Throws:
        IOException
        Since:
        3.4.3