Class FileActivityLog

  • All Implemented Interfaces:
    ActivityLog

    public class FileActivityLog
    extends AbstractActivityLog
    ActivityLog implementation that exposes the content of a local file.
    • Constructor Detail

      • FileActivityLog

        public FileActivityLog​(ActivityLog.Type type,
                               TranslatableMessage description,
                               File content)
        Creates a new FileActivityLog that exposes the content of the given local file as an ActivityLog.
        Parameters:
        type - The type of this ActivityLog.
        description - A human-readable message that describes this log.
        content - The File that should be used to provide the content of this log.
    • Method Detail

      • getSize

        public long getSize()
                     throws org.apache.guacamole.GuacamoleException
        Description copied from interface: ActivityLog
        Returns the number of bytes available for reading within the content of this log. If this value is unknown, -1 (ActivityLog.UNKNOWN_SIZE) should be returned.
        Returns:
        The number of bytes available for reading within the content of this log, or -1 (ActivityLog.UNKNOWN_SIZE) if this value is unknown.
        Throws:
        org.apache.guacamole.GuacamoleException - If the size of the content of this log cannot be determined due to an error.
      • getContent

        public InputStream getContent()
                               throws org.apache.guacamole.GuacamoleException
        Description copied from interface: ActivityLog
        Returns an InputStream that allows the content of this log to be read. Multiple instances of this InputStream may be open at any given time. It is the responsibility of the caller to close the returned InputStream.
        Returns:
        An InputStream that allows the content of this log to be read.
        Throws:
        org.apache.guacamole.GuacamoleException - If the content of this log cannot be read due to an error.