It's all about the answers!

Ask a question

download file (.process) using java api


Sumit Singh Tomar (266) | asked Jul 10 '14, 6:35 a.m.
 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));
}

Comments
Sumit Singh Tomar commented Jul 10 '14, 8:51 a.m. | edited Jul 10 '14, 9:30 a.m.

 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
Tim Mok (6.6k38) | answered Jul 10 '14, 8:42 a.m.
JAZZ DEVELOPER
 https://jazz.net/forum/questions/65218/how-to-download-files-from-rtc-server-by-java-application

Comments
Sumit Singh Tomar commented Jul 11 '14, 1:24 a.m. | edited Jul 11 '14, 4:29 a.m.

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


Sumit Singh Tomar commented Jul 11 '14, 1:29 a.m. | edited Jul 11 '14, 4:30 a.m.

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



Tim Mok commented Jul 14 '14, 8:25 a.m.
JAZZ DEVELOPER

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
sam detweiler (12.5k6195201) | answered Jul 10 '14, 9:08 a.m.
see Ralph's blog for samples of all kinds dealing with RTC and Source

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

permanent link
Ralph Schoon (63.5k33646) | answered Jul 11 '14, 4:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 11 '14, 4:32 a.m.
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.

Your answer


Register or 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.