Exception while retrieving IFileItem content
Hi,
I'm trying to retrieve the content of a IFileItem with the following code:
But I obtain the following exception:
What is the problem?
Alternatively, could I retrieve a versioned file directly and save it?
Thank you.
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.
One answer
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:
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
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/