net.fortuna.mstor.data
Class MetaFolderImpl

java.lang.Object
  extended by net.fortuna.mstor.data.MetaFolderImpl
All Implemented Interfaces:
MetaFolder

public class MetaFolderImpl
extends Object
implements MetaFolder

A JDOM-based implementation of a meta folder.

Author:
benfortuna

Field Summary
static String FILE_EXTENSION
           
 
Constructor Summary
MetaFolderImpl(File file)
          Constructs a new meta folder instance.
 
Method Summary
 void addMessage(MetaMessage message)
          Adds the specified message metadata.
 MetaMessage getMessage(Message message)
          Returns message metadata corresponding to the specified message id.
 String getName()
           
 MetaMessage removeMessage(int messageNumber)
          Removes the message metadata corresponding to the specified message number.
 MetaMessage[] removeMessages(int[] messageNumbers)
          Removes the message metadata corresponding to the specified message numbers.
 void save()
          Saves the meta data to the filesystem.
 void setName(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_EXTENSION

public static final String FILE_EXTENSION
See Also:
Constant Field Values
Constructor Detail

MetaFolderImpl

public MetaFolderImpl(File file)
Constructs a new meta folder instance.

Parameters:
file - the meta folder file
Method Detail

getName

public final String getName()
Specified by:
getName in interface MetaFolder
Returns:
Returns the name.

setName

public final void setName(String name)
Specified by:
setName in interface MetaFolder
Parameters:
name - The name to set.

getMessage

public final MetaMessage getMessage(Message message)
Description copied from interface: MetaFolder
Returns message metadata corresponding to the specified message id. If no metadata exists a new MetaMessage is created.

Specified by:
getMessage in interface MetaFolder
Returns:

addMessage

public final void addMessage(MetaMessage message)
Description copied from interface: MetaFolder
Adds the specified message metadata.

Specified by:
addMessage in interface MetaFolder

removeMessage

public final MetaMessage removeMessage(int messageNumber)
Description copied from interface: MetaFolder
Removes the message metadata corresponding to the specified message number.

Specified by:
removeMessage in interface MetaFolder
Parameters:
messageNumber - the number of the message metadata to remove
Returns:
the removed message metadata

removeMessages

public final MetaMessage[] removeMessages(int[] messageNumbers)
Description copied from interface: MetaFolder
Removes the message metadata corresponding to the specified message numbers.

Specified by:
removeMessages in interface MetaFolder
Returns:
an array of the removed message metadata

save

public final void save()
                throws IOException
Description copied from interface: MetaFolder
Saves the meta data to the filesystem.

Specified by:
save in interface MetaFolder
Throws:
IOException