proper.remote.messages
Class FileMessage

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.remote.messages.Message
          extended by proper.remote.messages.DataMessage
              extended by proper.remote.messages.FileMessage
All Implemented Interfaces:
ProperInterface

public class FileMessage
extends DataMessage

This class encapsulates a FileMessage, where the data of the payload (file or something like this) is in the <body> tag of the Message, besides the the name of the file.
The actual data looks like this:

    ...
    <body>
       <data>
          <filename>the filename</filename>
          <line>...</line>
          ...
       </data>
    </body>
    ...
 

Version:
$Revision: 1.2 $
Author:
FracPete
See Also:
Message

Field Summary
static java.lang.String FILENAME
          the filename tag
 
Fields inherited from class proper.remote.messages.DataMessage
DATA, LINE
 
Fields inherited from class proper.remote.messages.Message
BODY, FROM, HEADER, IP, MESSAGE, PORT, TYPE
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
FileMessage()
          initializes the object
FileMessage(Message msg)
          initializes the object with the given Message
FileMessage(java.io.Reader reader)
          initializes the object with the given xml data
 
Method Summary
 void clearBody()
          sets the body back to standard
 java.lang.String getFilename()
          returns the filename
 boolean isOtherMessage(Message msg)
          checks whether this message is of a different type, is used to determine whether the body has to be cleared if the data is copied from another Message
static void main(java.lang.String[] args)
          for testing only
 void setFilename(java.lang.String filename)
          sets the filename
 void setLines(java.util.Vector lines)
          sets the given lines in the message
 
Methods inherited from class proper.remote.messages.DataMessage
getData, getLine, getLineCount, getLines, setLines, setLines
 
Methods inherited from class proper.remote.messages.Message
clear, getBody, getBodyContent, getContent, getContent, getContent, getContent, getContent, getHeader, getIP, getPort, getType, setBodyContent, setContent, setIP, setPort, setType, toString
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILENAME

public static final java.lang.String FILENAME
the filename tag

See Also:
Constant Field Values
Constructor Detail

FileMessage

public FileMessage()
initializes the object


FileMessage

public FileMessage(java.io.Reader reader)
initializes the object with the given xml data


FileMessage

public FileMessage(Message msg)
initializes the object with the given Message

Method Detail

isOtherMessage

public boolean isOtherMessage(Message msg)
checks whether this message is of a different type, is used to determine whether the body has to be cleared if the data is copied from another Message

Overrides:
isOtherMessage in class DataMessage
See Also:
FileMessage(Message), clearBody()

clearBody

public void clearBody()
sets the body back to standard

Overrides:
clearBody in class DataMessage

getFilename

public java.lang.String getFilename()
returns the filename


setFilename

public void setFilename(java.lang.String filename)
sets the filename


setLines

public void setLines(java.util.Vector lines)
sets the given lines in the message

Overrides:
setLines in class DataMessage

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
for testing only

Throws:
java.lang.Exception