public abstract class MboxStorageWriter extends Object implements IDisposable, Closeable
A base class for any mbox-based mail storage writer.
Modifier | Constructor and Description |
---|---|
protected |
MboxStorageWriter(OutputStream stream,
boolean leaveOpen)
Initializes a new instance of the
MboxStorageWriter class. |
protected |
MboxStorageWriter(Stream stream,
boolean leaveOpen)
Initializes a new instance of the
MboxStorageWriter class. |
protected |
MboxStorageWriter(String fileName,
boolean leaveOpen)
Initializes a new instance of the
MboxStorageWriter class. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
protected void |
dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources
|
void |
flush()
flush.
|
InputStream |
getBaseStream()
Deprecated.
|
abstract void |
writeMessage(MailMessage message)
Writes the message to underlying storage stream.
|
abstract void |
writeMessage(MailMessage message,
String[] fromMarker)
Writes the message to underlying storage stream.
|
protected MboxStorageWriter(OutputStream stream, boolean leaveOpen)
Initializes a new instance of the MboxStorageWriter
class.
stream
- The stream.leaveOpen
- if set to true
leaves the underlying stream open after disposing.ArgumentNullException
- If given stream is null.protected MboxStorageWriter(Stream stream, boolean leaveOpen)
Initializes a new instance of the MboxStorageWriter
class.
stream
- The stream.leaveOpen
- if set to true
leaves the underlying stream open after disposing.ArgumentNullException
- If given stream is null.protected MboxStorageWriter(String fileName, boolean leaveOpen)
Initializes a new instance of the MboxStorageWriter
class.
fileName
- Name of the file.leaveOpen
- if set to true
leaves the underlying stream open after disposing.ArgumentNullException
- If filename is null or empty.@Deprecated public InputStream getBaseStream()
Gets the base stream.
Value: The base stream.public abstract void writeMessage(MailMessage message)
Writes the message to underlying storage stream.
message
- The message to write to.public abstract void writeMessage(MailMessage message, String[] fromMarker)
Writes the message to underlying storage stream.
message
- The message to write to.fromMarker
- Gets the From Marker while writing the MBox Storage file.public final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface IDisposable
public void close()
close
in interface Closeable
close
in interface AutoCloseable
protected void dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources
disposing
- true
to release both managed and unmanaged resources; false
to release only unmanaged resources.public void flush()
flush.