Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

samples.attachments
Class EchoAttachment  view EchoAttachment download EchoAttachment.java

java.lang.Object
  extended bysamples.attachments.EchoAttachment

public class EchoAttachment
extends java.lang.Object

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
(package private)  org.apache.axis.utils.Options opts
           
 
Constructor Summary
EchoAttachment(org.apache.axis.utils.Options opts)
           
 
Method Summary
protected  boolean compareFiles(java.lang.String one, java.lang.String other)
          Quick and unsophisticated method to compare two file's byte stream.
 boolean echo(boolean doTheDIME, java.lang.String filename)
          This method sends a file as an attachment then receives it as a return.
 boolean echoDir(boolean doTheDIME, java.lang.String filename)
          This method sends all the files in a directory.
 boolean echoUsingSAAJ(java.lang.String filename)
          This method sends a file as an attachment then receives it as a return.
protected  javax.activation.DataHandler[] getAttachmentsFromDir(java.lang.String dirName)
          Return an array of datahandlers for each file in the dir.
static void main(java.lang.String[] args)
          Give a single file to send or name a directory to send an array of attachments of the files in that directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opts

org.apache.axis.utils.Options opts
Constructor Detail

EchoAttachment

public EchoAttachment(org.apache.axis.utils.Options opts)
Method Detail

echo

public boolean echo(boolean doTheDIME,
                    java.lang.String filename)
             throws java.lang.Exception
This method sends a file as an attachment then receives it as a return. The returned file is compared to the source.


echoDir

public boolean echoDir(boolean doTheDIME,
                       java.lang.String filename)
                throws java.lang.Exception
This method sends all the files in a directory.


main

public static void main(java.lang.String[] args)
Give a single file to send or name a directory to send an array of attachments of the files in that directory.


compareFiles

protected boolean compareFiles(java.lang.String one,
                               java.lang.String other)
                        throws java.io.FileNotFoundException,
                               java.io.IOException
Quick and unsophisticated method to compare two file's byte stream.


getAttachmentsFromDir

protected javax.activation.DataHandler[] getAttachmentsFromDir(java.lang.String dirName)
Return an array of datahandlers for each file in the dir.


echoUsingSAAJ

public boolean echoUsingSAAJ(java.lang.String filename)
                      throws java.lang.Exception
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.