Class CSLUtils


  • public class CSLUtils
    extends java.lang.Object
    Utilities for the CSL processor
    Author:
    Michel Kraemer
    • Constructor Summary

      Constructors 
      Constructor Description
      CSLUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String readStreamToString​(java.io.InputStream is, java.lang.String encoding)
      Reads a string from a stream.
      static java.lang.String readURLToString​(java.net.URL u, java.lang.String encoding)
      Reads a string from a URL
      • Methods inherited from class java.lang.Object

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

      • CSLUtils

        public CSLUtils()
    • Method Detail

      • readURLToString

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

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