com.esri.arcgis.geodatabase
Class Attachment

java.lang.Object
  extended by com.esri.arcgis.geodatabase.Attachment
All Implemented Interfaces:
IAttachment, IAttachment2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class Attachment
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IAttachment2

.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
Attachment()
          Constructs a Attachment using ArcGIS Engine.
Attachment(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Attachment theAttachment = (Attachment) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 int getAttachmentID()
          ID that uniquely identifies the attachment.
static String getClsid()
          getClsid.
 String getContentType()
          Content type that describes the attachment data.
 IMemoryBlobStream getData()
          Attachment data.
 String getGlobalID()
          Global ID that uniquely identifies the attachment.
 String getName()
          Name of the attachment.
 String getParentGlobalID()
          Parent global ID to which the attachment belongs.
 int getParentID()
          Parent ID to which the attachment belongs.
 int getSize()
          Size of the attachment data in bytes.
 int hashCode()
          the hashcode for this object
 void setContentType(String contentType)
          Content type that describes the attachment data.
 void setDataByRef(IMemoryBlobStream data)
          Attachment data.
 void setName(String name)
          Name of the attachment.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

Attachment

public Attachment()
           throws IOException,
                  UnknownHostException
Constructs a Attachment using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

Attachment

public Attachment(Object obj)
           throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Attachment theAttachment = (Attachment) obj;

Construct a Attachment using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Attachment.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getParentGlobalID

public String getParentGlobalID()
                         throws IOException,
                                AutomationException
Parent global ID to which the attachment belongs.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getParentGlobalID in interface IAttachment2
Returns:
The parentGlobalID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAttachmentID

public int getAttachmentID()
                    throws IOException,
                           AutomationException
ID that uniquely identifies the attachment.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getAttachmentID in interface IAttachment
Returns:
The attID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGlobalID

public String getGlobalID()
                   throws IOException,
                          AutomationException
Global ID that uniquely identifies the attachment.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getGlobalID in interface IAttachment
Returns:
The globalID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParentID

public int getParentID()
                throws IOException,
                       AutomationException
Parent ID to which the attachment belongs.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getParentID in interface IAttachment
Returns:
The oID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

public void setName(String name)
             throws IOException,
                    AutomationException
Name of the attachment.

Remarks

The name property should be identical to the name of the attached file. This means no special characters or spaces should be used.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setName in interface IAttachment
Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public String getName()
               throws IOException,
                      AutomationException
Name of the attachment.

Remarks

The name property should be identical to the name of the attached file. This means no special characters or spaces should be used.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getName in interface IAttachment
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setContentType

public void setContentType(String contentType)
                    throws IOException,
                           AutomationException
Content type that describes the attachment data.

Remarks

The ContentType property must be populated with the full MIME type name as would be used in an HTTP request for the items being attached. The MIME type string should consist of both the type and the subtype and follow the pattern (without the square brackets) of [MIME type name]/[MIME subtype name]. An attached jpeg image would have a MIME type of image, and a MIME subtype of jpeg, yielding a ContentType string of image/jpeg.

Below are a few common examples:

Full MIME Type Name Common File Extension Purpose
text/html .html Web Page
image/png .png PNG-format image
image/jpeg .jpeg JPEG-format image
audio/mpeg .mp3 MPEG Audio File

The official list can be found at http://www.iana.org/assignments/media-types/index.html

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setContentType in interface IAttachment
Parameters:
contentType - The contentType (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getContentType

public String getContentType()
                      throws IOException,
                             AutomationException
Content type that describes the attachment data.

Remarks

The ContentType property must be populated with the full MIME type name as would be used in an HTTP request for the items being attached. The MIME type string should consist of both the type and the subtype and follow the pattern (without the square brackets) of [MIME type name]/[MIME subtype name]. An attached jpeg image would have a MIME type of image, and a MIME subtype of jpeg, yielding a ContentType string of image/jpeg.

Below are a few common examples:

Full MIME Type Name Common File Extension Purpose
text/html .html Web Page
image/png .png PNG-format image
image/jpeg .jpeg JPEG-format image
audio/mpeg .mp3 MPEG Audio File

The official list can be found at http://www.iana.org/assignments/media-types/index.html

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getContentType in interface IAttachment
Returns:
The contentType
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSize

public int getSize()
            throws IOException,
                   AutomationException
Size of the attachment data in bytes.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSize in interface IAttachment
Returns:
The size
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDataByRef

public void setDataByRef(IMemoryBlobStream data)
                  throws IOException,
                         AutomationException
Attachment data.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setDataByRef in interface IAttachment
Parameters:
data - A reference to a com.esri.arcgis.system.IMemoryBlobStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getData

public IMemoryBlobStream getData()
                          throws IOException,
                                 AutomationException
Attachment data.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getData in interface IAttachment
Returns:
A reference to a com.esri.arcgis.system.IMemoryBlobStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.