Package org.apache.guacamole.net.auth
Class FileActivityLog
- java.lang.Object
-
- org.apache.guacamole.net.auth.AbstractActivityLog
-
- org.apache.guacamole.net.auth.FileActivityLog
-
- All Implemented Interfaces:
ActivityLog
public class FileActivityLog extends AbstractActivityLog
ActivityLog implementation that exposes the content of a local file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.guacamole.net.auth.ActivityLog
ActivityLog.Type
-
-
Field Summary
-
Fields inherited from interface org.apache.guacamole.net.auth.ActivityLog
UNKNOWN_SIZE
-
-
Constructor Summary
Constructors Constructor Description FileActivityLog(ActivityLog.Type type, TranslatableMessage description, File content)
Creates a new FileActivityLog that exposes the content of the given local file as anActivityLog
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
getContent()
Returns an InputStream that allows the content of this log to be read.long
getSize()
Returns the number of bytes available for reading within the content of this log.-
Methods inherited from class org.apache.guacamole.net.auth.AbstractActivityLog
getDescription, getType
-
-
-
-
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 anActivityLog
.- 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.
-
-