Found this file on my laptop, it may give you a start.
--
Jarl
2009/9/16 senthil kumar <[email protected]>:
> **
>
> Hi,
>
> I am new to Java API but I need to fetch the attachemt files from
> attachment pool by using Java API. I dont know which method i need to call
> to get attachement files.
>
> Could you please suggest how to proceed on this.
>
> Remedy Version : 7.1
>
> Os: Linux
>
> Thanks.
>
> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
> Are"_
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"
import com.remedy.arsys.api.*;
public class getAttach
{
public static void main(String args[])
{
// Username to login to ARServer
String uname = "Demo";
// Password for the User
String pword = "";
// Language
String lang = "";
// ARServer
String serv = "";
// Create ARServerUser object with supporting information.
ARServerUser context = new ARServerUser(uname, pword, lang, serv);
// Create NameID object adding the form name you wish to retrieve the attachment from in the constructor.
NameID schemaID = new NameID("RESOURCE_Downloads");
// Create EntryID object adding the EntryID of the record you wish to retrieve the attachment from in the constructor
EntryID entryID = new EntryID("000000000000007");
// Create FieldID object adding the fieldID of the attachment field in the constructor
long fid = 536880912;
FieldID fieldID = new FieldID(fid);
// Need to have the Util.ARGetEntryBlob() method in a try block to catch ARException
try
{
// Set a string variable for the name of the attachment
String aname = "ConvertQual.def";
// Set a string variable for the full path of where you wish to copy the attachment to.
String filePath = "C:\\ConvertQual.def";
// Create AttachmentInfo object with supporting information
AttachmentInfo attach = new AttachmentInfo(aname, 0, 0, "");
// Call the setValue() method of the AttachmentInfo object passing in the "full path" string variable.
attach.setValue(filePath);
// Call ARGetEntryBlob with supporting information
Util.ARGetEntryBlob(context, schemaID, entryID, fieldID, attach);
}
catch (ARException e)
{
System.out.println("Exception: " + e.toString());
}
}
}