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));
}
3 answers
https://jazz.net/forum/questions/65218/how-to-download-files-from-rtc-server-by-java-application
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.
see Ralph's blog for samples of all kinds dealing with RTC and Source
http://rsjazz.wordpress.com/?s=source
http://rsjazz.wordpress.com/?s=source
Comments
In particular:
(Downloads into a zip file)
http://thescmlounge.blogspot.com/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html
(Uploads)
https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/
https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/
Unclear what you want here. Basically you have two options as I see it.
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.
- 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.
- 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.
Comments
Sumit Singh Tomar
Jul 10 '14, 9:30 a.m.Thanks