Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Exception while retrieving IFileItem content

Hi,

I'm trying to retrieve the content of a IFileItem with the following code:

IVersionable versionable = ...


IFileItem fileItem = (IFileItem) versionable;
IFileItemHandle fileHandle = (IFileItemHandle) fileItem.getItemHandle();
IFileContent content = fileItem.getContent();
contentManager.retrieveContent(fileHandle, content, outputStream, null);


But I obtain the following exception:

Exception in thread "main" java.lang.IllegalArgumentException

at com.ibm.team.scm.client.content.BasicVersionedContentManager.retrieveContentStream(BasicVersionedContentManager.java:1114)
at com.ibm.team.filesystem.client.internal.content.FileContentManager.retrieveContentStream(FileContentManager.java:160)
at ...


What is the problem?

Alternatively, could I retrieve a versioned file directly and save it?

Thank you.

0 votes



One answer

Permanent link
I'm not 100% sure on this, but try passing in "fileItem" as opposed to
fileHandle (aka, fileItem.getItemHandle()) into the contentManager call.
FileItem extends FileItemHandle. State information might be getting lost
in the getItemHandle() call.



On Fri, 23 Oct 2009 11:08:01 -0400, kostja79
<daniele> wrote:

Hi,

I'm trying to retrieve the content of a IFileItem with the following
code:

IVersionable versionable = ...

IFileItem fileItem = (IFileItem) versionable;
IFileItemHandle fileHandle = (IFileItemHandle)
fileItem.getItemHandle();
IFileContent content = fileItem.getContent();
contentManager.retrieveContent(fileHandle, content, outputStream,
null);

But I obtain the following exception:

Exception in thread "main"
java.lang.IllegalArgumentException
at
com.ibm.team.scm.client.content.BasicVersionedContentManager.retrieveContentStream(BasicVersionedContentManager.java:1114)
at
com.ibm.team.filesystem.client.internal.content.FileContentManager.retrieveContentStream(FileContentManager.java:160)
at ...


What is the problem?

Alternatively, could I retrieve a versioned file directly and save
it?

Thank you.



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943

Question asked: Oct 23 '09, 11:06 a.m.

Question was seen: 6,365 times

Last updated: Oct 23 '09, 11:06 a.m.

Confirmation Cancel Confirm