| java.lang.Object samples.attachments.EchoAttachment
EchoAttachment | public class EchoAttachment (Code) | | An example of sending an attachment via RPC.
This class has a main method that beside the standard arguments
allows you to specify an attachment that will be sent to a
service which will then send it back.
|
Field Summary | |
Options | opts |
Method Summary | |
protected boolean | compareFiles(String one, String other) Quick and unsophisticated method to compare two file's
byte stream.
Parameters: The - first file to compare. Parameters: The - second file to compare. | public boolean | echo(boolean doTheDIME, String filename) This method sends a file as an attachment then
receives it as a return. | public boolean | echoDir(boolean doTheDIME, String filename) This method sends all the files in a directory. | public boolean | echoUsingSAAJ(String filename) This method sends a file as an attachment then
receives it as a return. | protected DataHandler[] | getAttachmentsFromDir(String dirName) Return an array of datahandlers for each file in the dir. | public static void | main(String args) Give a single file to send or name a directory
to send an array of attachments of the files in
that directory. |
EchoAttachment | public EchoAttachment(Options opts)(Code) | | |
compareFiles | protected boolean compareFiles(String one, String other) throws java.io.FileNotFoundException, java.io.IOException(Code) | | Quick and unsophisticated method to compare two file's
byte stream.
Parameters: The - first file to compare. Parameters: The - second file to compare. True if the bytestreams do compare, false forany other reason. |
echo | public boolean echo(boolean doTheDIME, String filename) throws Exception(Code) | | This method sends a file as an attachment then
receives it as a return. The returned file is
compared to the source.
Parameters: The - filename that is the source to send. True if sent and compared. |
echoDir | public boolean echoDir(boolean doTheDIME, String filename) throws Exception(Code) | | This method sends all the files in a directory.
Parameters: The - directory that is the source to send. True if sent and compared. |
echoUsingSAAJ | public boolean echoUsingSAAJ(String filename) throws Exception(Code) | | This method sends a file as an attachment then
receives it as a return. The returned file is
compared to the source. Uses SAAJ API.
Parameters: The - filename that is the source to send. True if sent and compared. |
getAttachmentsFromDir | protected DataHandler[] getAttachmentsFromDir(String dirName)(Code) | | Return an array of datahandlers for each file in the dir.
Parameters: the - name of the directory return an array of datahandlers. |
main | public static void main(String args)(Code) | | Give a single file to send or name a directory
to send an array of attachments of the files in
that directory.
|
|
|