This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
Adding tags via updateFileMetadata adds tag_word to the tags #1769
Open
Description
Hi,
I am trying to add tags to a file via the updateFileMetadata method provided by FileService. However, when adding a tag, for example tag1, to a file, the tag tag_word is also automatically added. The problem also occurs with updateCommunityFileMetadata. This is my method for adding tags to a file:
public static void updateFileMetaData(final Connection connection, final String communityId, final File file, final List<String> tags)
{
final FileService service = new FileService(connection.getEndpoint());
Map<String, String> paramsMap = null;
if (tags != null) { paramsMap = buildFileTags(tags); }
try
{
if (paramsMap != null)
{
if (communityId.isEmpty()) { service.updateFileMetadata(file, paramsMap); }
else { service.updateCommunityFileMetadata(file, file.getLibraryId(), paramsMap); }
}
}
catch (final ClientServicesException e) { throw new RuntimeException(e); }
}
public static Map<String, String> buildFileTags(final List<String> tags)
{
final FileCreationParameters p = new FileCreationParameters();
for (final String tag : tags) { p.tags.add(tag); }
return p.buildParameters();
}
Metadata
Assignees
Labels
No labels
Activity