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

RTC SDK: Giving names to the files uploaded

When uploading files into a repository using RTC Eclipse IDE it does not retain the original file name and asks the user to name it.

One customer created a RTC Eclipse plugin that uploads more than one file to a Work Item and noticed this same behaviour. He wants to know if there's any API that could be used in order to upload the file and keep its name.
 

0 votes



2 answers

Permanent link
Hi, this post describes the upload process. http://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/ . As far as I recall the name can be set. If I upload a file to a work item, the file name is typically kept.

2 votes


Permanent link
If this can helps you, we programmatically add new contributions to Build Results as:
File file = new File(path);
ITeamRepository repo = ...
IContent content = repo.contentManager().storeContent(IContent.CONTENT_TYPE_UNKNOWN, null, LineDelimiter.LINE_DELIMITER_NONE, inputStream, null, null);InputStream inputStream = new FileInputStream(file); IBuildResultContribution contribution = BuildItemFactory.createBuildResultContribution();  contribution.setComponentName(componentName);
contribution.setLabel(label);
contribution.setExtendedContributionTypeId(IBuildResultContribution.ARTIFACT_EXTENDED_CONTRIBUTION_ID);
contribution.setExtendedContributionProperty(IBuildResultContribution.PROPERTY_NAME_FILE_NAME, file.getName());
contribution.setExtendedContributionData(content);
ITeamBuildClient buildClient = (ITeamBuildClient) repo.getClientLibrary(ITeamBuildClient.class); IBuildResult buildResult = ...
buildClient.addBuildResultContribution(buildResult, contribution, null);
As you can see, we use the same filename from the input file:
contribution.setExtendedContributionProperty(IBuildResultContribution.PROPERTY_NAME_FILE_NAME, file.getName());
	

1 vote

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,952
× 7,507

Question asked: Jan 21 '13, 8:03 a.m.

Question was seen: 4,489 times

Last updated: Jan 21 '13, 8:54 a.m.

Confirmation Cancel Confirm