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

download file (.process) using java api

 Hi Team, 

We want to downlod one file from repository(RTC) by using java api... 

please provide detail descritption of every class. (what is IWorkspaceHandle) and all..

PSA of below code for the same

ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);
repo.registerLoginHandler(new ILoginHandler2() {
@Override
public ILoginInfo2 challenge(ITeamRepository repo) {
return new UsernameAndPasswordLoginInfo(userId, password);
}
});
System.out.println("login begin");
repo.login(monitor);
System.out.println("Successfully login");
IWorkspaceManager manager=SCMPlatform.getWorkspaceManager(repo);
String UUIDStr = "_nsXjlEVkEeCyA4xyic0frg";

UUID workspaceUuid = UUID.valueOf(UUIDStr);

IWorkspaceHandle workspaceHandle = (IWorkspaceHandle)IWorkspace.ITEM_TYPE.createItemHandle(workspaceUuid, null);
//handle=(IWorkspaceHandle) loadComponents(repo, "159515-ESB-DEV",1, monitor).get(0);
//manager.findComponents("com", null, true, null);
IWorkspaceConnection  connection= manager.getWorkspaceConnection(workspaceHandle, monitor);
List<Component> list= repo.itemManager().fetchCompleteItems(connection.getComponents(),ItemManager.DEFAULT,monitor);
for(int i=0;i<list.size();i++)
{
System.out.println(list.get(i));
}

0 votes

Comments

 Thanks


But how to get workspace connection. I am stucking in IWorkspaceHandle things which need to be passed to get workspace connection.

can you please suggest me on that...

Thanks,
Sumit



3 answers

Permanent link
 https://jazz.net/forum/questions/65218/how-to-download-files-from-rtc-server-by-java-application

0 votes

Comments

 is there any way to download the particular file from stream->> components....??

 I mean we are taking file from workspace...we need to take file from stream-->components


It's the same thing. That post describes how to get the particular item in a stream/workspace (ie. IWorkspaceConnection) and then retrieve an output stream to get the file.


Permanent link
see Ralph's blog for samples of all kinds dealing with RTC and Source

http://rsjazz.wordpress.com/?s=source

0 votes


Permanent link
Unclear what you want here. Basically you have two options as I see it.
  1. You read up on the scm commandline in the help (search for lscm or scm) in the online help. You can load a repository workspace and download files and then act on them.
  2. You use the API in which case the links above provide all you need. You will have to create your own local file and get the content as described in the post http://thescmlounge.blogspot.com/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html

There are no there options I am aware of.

If you ask how to download the data from a stream (and not a workspace) the code is the same for all except finding the stream. A repository workspace and a stream are almost identical. For the read operations anyway.

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

Question asked: Jul 10 '14, 6:35 a.m.

Question was seen: 3,934 times

Last updated: Jul 14 '14, 8:25 a.m.

Confirmation Cancel Confirm