java.lang.Object
com.aoapps.messaging.FileMessage
- All Implemented Interfaces:
Message,Closeable,AutoCloseable
A message that is a file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()The message should be closed when it is no longer needed.static FileMessageDeprecated, for removal: This API element is subject to removal in a future version.static FileMessageRestores this message into the provided file.static FileMessageDeprecated, for removal: This API element is subject to removal in a future version.Please useTempFileContextsupplier sinceFile.deleteOnExit()is prone to memory leaks in long-running applications.static FileMessageBase-64 decodes the message into the provided file.Gets a binary representation of this message.Base-64 encodes the message.booleanTwo messages of the same type with the same body must be considered equal.Gets the message type.inthashCode()The hash code must be consistent with equals.booleanisTemp()toString()
-
Constructor Details
-
FileMessage
Creates a newFileMessage.
-
-
Method Details
-
decode
Base-64 decodes the message into the provided file.- Throws:
IOException- See Also:
-
decode
@Deprecated(forRemoval=true) public static FileMessage decode(String encodedMessage) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Please useTempFileContextsupplier 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(forRemoval=true) public static FileMessage decode(ByteArray encodedMessage) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Please useTempFileContextsupplier 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:MessageTwo messages of the same type with the same body must be considered equal. -
hashCode
public int hashCode()Description copied from interface:MessageThe hash code must be consistent with equals. -
getMessageType
Description copied from interface:MessageGets the message type.- Specified by:
getMessageTypein interfaceMessage
-
encodeAsString
Base-64 encodes the message.- Specified by:
encodeAsStringin interfaceMessage- Throws:
IOException
-
encodeAsByteArray
Description copied from interface:MessageGets a binary representation of this message.- Specified by:
encodeAsByteArrayin interfaceMessage- Throws:
IOException
-
close
Description copied from interface:MessageThe message should be closed when it is no longer needed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceMessage- Throws:
IOException
-
isTemp
public boolean isTemp() -
getMessage
-

TempFileContextsupplier sinceFile.deleteOnExit()is prone to memory leaks in long-running applications.