FileDocCategorySizeDatePackage
AttachmentUtils.javaAPI DocApache Axis 1.42220Sat Apr 22 18:57:28 BST 2006org.apache.axis.attachments

AttachmentUtils

public class AttachmentUtils extends Object
This class allow access to the Jaf data handler in AttachmentPart.
author
Rick Rineholt

Fields Summary
Constructors Summary
private AttachmentUtils()

    
Methods Summary
public static javax.activation.DataHandlergetActivationDataHandler(org.apache.axis.Part part)
Obtain the DataHandler from the part.

param
part the part containing the Java Activiation Framework data source.
return
The Java activation data handler.
throws
AxisFault


        if (null == part) {
            throw new AxisFault(Messages.getMessage("gotNullPart"));
        }

        if (!(part instanceof AttachmentPart)) {
            throw new AxisFault(
                    Messages.getMessage(
                            "unsupportedAttach", part.getClass().getName(),
                            AttachmentPart.class.getName()));
        }

        return ((AttachmentPart) part).getActivationDataHandler();
    
public static booleanisAttachment(java.lang.Object value)
Determine if an object is to be treated as an attchment.

param
value the value that is to be determined if its an attachment.
return
True if value should be treated as an attchment.


        if (null == value) {
            return false;
        }

        return value instanceof javax.activation.DataHandler;