com.esri.arcgis.geodatabase
Interface IAttachment

All Superinterfaces:
Serializable
All Known Subinterfaces:
IAttachment2
All Known Implementing Classes:
Attachment

public interface IAttachment
extends Serializable

Provides access to members of an attachment.

Product Availability

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


Method Summary
 int getAttachmentID()
          ID that uniquely identifies the attachment.
 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.
 int getParentID()
          Parent ID to which the attachment belongs.
 int getSize()
          Size of the attachment data in bytes.
 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.
 

Method Detail

getAttachmentID

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

Product Availability

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

Returns:
The attID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGlobalID

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

Product Availability

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

Returns:
The globalID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParentID

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

Product Availability

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

Returns:
The oID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

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.

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

getName

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.

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setContentType

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.

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

getContentType

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.

Returns:
The contentType
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSize

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

Product Availability

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

Returns:
The size
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDataByRef

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

Product Availability

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

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

IMemoryBlobStream getData()
                          throws IOException,
                                 AutomationException
Attachment data.

Product Availability

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

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.