Class CTISessionHelper

java.lang.Object
jp.cssj.cti2.helpers.CTISessionHelper

public final class CTISessionHelper extends Object
Utilities for sending client-side files, URLs, and streams.
  • Method Details

    • setResultFile

      public static void setResultFile(CTISession session, File file) throws IOException
      Sets the output file.
      Parameters:
      session -
      file -
      Throws:
      IOException
    • setResultStream

      public static void setResultStream(CTISession session, OutputStream out) throws IOException
      Sets the output stream.
      Parameters:
      session -
      out -
      Throws:
      IOException
    • properties

      public static void properties(CTISession session, Properties props) throws IOException
      Sets multiple properties at once.
      Parameters:
      session -
      props -
      Throws:
      IOException
    • sendResourceFile

      public static void sendResourceFile(CTISession session, File file, String mimeType, String encoding) throws IOException
      Sends a file as a resource.
      Parameters:
      session - The session
      file - The file
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
    • sendResourceURL

      public static void sendResourceURL(CTISession session, URL url, String mimeType, String encoding) throws IOException
      Sends a URL as a resource.
      Parameters:
      session - The session
      url - URL
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
    • sendResourceStream

      public static void sendResourceStream(CTISession session, InputStream in, URI uri, String mimeType, String encoding) throws IOException
      Sends data read from a stream as a resource.
      Parameters:
      session - The session
      in - The input stream
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
    • sendResourceDir

      public static void sendResourceDir(CTISession session, File dir, String mimeType, String encoding) throws IOException
      Sends all files in a directory as resources. This method also processes subdirectories recursively.
      Parameters:
      session - The session
      dir - The directory
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
    • transcodeFile

      public static void transcodeFile(CTISession session, File file, String mimeType, String encoding) throws IOException, TranscoderException
      Sends a file as the document body.
      Parameters:
      session - The session
      file - The file
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
      TranscoderException
    • transcodeURL

      public static void transcodeURL(CTISession session, URL url, String mimeType, String encoding) throws IOException, TranscoderException
      Sends a URL as the document body.
      Parameters:
      session - The session
      url - URL
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
      TranscoderException
    • transcodeStream

      public static void transcodeStream(CTISession session, InputStream in, URI uri, String mimeType, String encoding) throws IOException, TranscoderException
      Sends data read from a stream as the document body.
      Parameters:
      session - The session
      in - The input stream
      mimeType - The MIME type (null if omitted)
      encoding - The encoding (null if omitted)
      Throws:
      IOException
      TranscoderException