java.lang.Object
com.aoapps.messaging.FileMessage
- All Implemented Interfaces:
Message
,Closeable
,AutoCloseable
A message that is a file.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
The message should be closed when it is no longer needed.static FileMessage
Deprecated.static FileMessage
Restores this message into the provided file.static FileMessage
Deprecated.Please useTempFileContext
supplier sinceFile.deleteOnExit()
is prone to memory leaks in long-running applications.static FileMessage
base-64 decodes the message into the provided file.Gets a binary representation of this message.base-64 encodes the message.boolean
Two messages of the same type with the same body must be considered equal.Gets the message type.int
hashCode()
The hash code must be consistent with equals.boolean
isTemp()
toString()
-
Constructor Details
-
FileMessage
-
-
Method Details
-
decode
base-64 decodes the message into the provided file.- Throws:
IOException
- See Also:
-
decode
Deprecated.Please useTempFileContext
supplier sinceFile.deleteOnExit()
is prone to memory leaks in long-running applications.base-64 decodes the message into a temp file.- Throws:
IOException
- See Also:
-
decode
Restores this message into the provided file.- Throws:
IOException
- See Also:
-
decode
Deprecated.Please useTempFileContext
supplier sinceFile.deleteOnExit()
is prone to memory leaks in long-running applications.Restores this message into a temp file.- Throws:
IOException
- See Also:
-
toString
-
equals
Description copied from interface:Message
Two messages of the same type with the same body must be considered equal. -
hashCode
public int hashCode()Description copied from interface:Message
The hash code must be consistent with equals. -
getMessageType
Description copied from interface:Message
Gets the message type.- Specified by:
getMessageType
in interfaceMessage
-
encodeAsString
base-64 encodes the message.- Specified by:
encodeAsString
in interfaceMessage
- Throws:
IOException
-
encodeAsByteArray
Description copied from interface:Message
Gets a binary representation of this message.- Specified by:
encodeAsByteArray
in interfaceMessage
- Throws:
IOException
-
close
Description copied from interface:Message
The message should be closed when it is no longer needed.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceMessage
- Throws:
IOException
-
isTemp
public boolean isTemp() -
getMessage
-
TempFileContext
supplier sinceFile.deleteOnExit()
is prone to memory leaks in long-running applications.