Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

FileService updateCommunityFile not working #1624

Closed
teunhoogendoorn opened this issue Oct 15, 2014 · 3 comments
Closed

FileService updateCommunityFile not working #1624

teunhoogendoorn opened this issue Oct 15, 2014 · 3 comments

Comments

@teunhoogendoorn
Copy link

Hi,

I'm having troubles updating a community file with the FileService.updateCommunityFile (com.ibm.sbt.core / 1.1.0.20140717-1200).

I'm getting file not found errors.

I can update non community files with FileService.updateFile.

Is there a reason why both methods are so different?

public File updateFile(InputStream inputStream, File file, Map<String, String> params)
public File updateCommunityFile(InputStream iStream, String fileId, String title, String communityLibraryId, Map<String, String> params)

Updating a community file can only be done (as far as I know) with a fileId (why not a File like updateFile?) and a communityLibraryId). Also, why do I need to provide a title?

Shouldn't both methods be more or less the same (only difference should be communityId in my opinion)?

Thanks,

Teun Hoogendoorn

@stijn22
Copy link

stijn22 commented Oct 27, 2014

I have the same problem. updateFile is working fine, but updateCommunityFile gives file not found errors.

Also, when providing a params map which contains a single tag (multiple tags are not yet supported), the tag is not updated.

@emmaleisisw
Copy link

I just had the same problem with the FileService.updateCommunityFileMetadata method, and fixed it with a very simple change to my code. I assume it will be the same for updateCommunityFile.

It appears that the communityLibraryId required by these methods is not the community UUID. Community files actually have a library id which is different to the community UUID.

In my case, I wanted to update the metadata of a community file after the intial upload, just to add tags. I have a File object returned from the upload, and passing file.getLibraryId() as the communityLibraryId argument made this work.

@teunhoogendoorn
Copy link
Author

Thanks sjleis for your response!

Using the communityLibraryId also "fixes" my problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants