Class CSLUtils


  • public class CSLUtils
    extends Object
    Utilities for the CSL processor
    Author:
    Michel Kraemer
    • Constructor Detail

      • CSLUtils

        public CSLUtils()
    • Method Detail

      • readURLToString

        public static String readURLToString​(URL u,
                                             String encoding)
                                      throws IOException
        Reads a string from a URL
        Parameters:
        u - the URL
        encoding - the character encoding
        Returns:
        the string
        Throws:
        IOException - if the URL contents could not be read
      • readStreamToString

        public static String readStreamToString​(InputStream is,
                                                String encoding)
                                         throws IOException
        Reads a string from a stream. Closes the stream after reading.
        Parameters:
        is - the stream
        encoding - the character encoding
        Returns:
        the string
        Throws:
        IOException - if the stream contents could not be read