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

Java API for listing/retrieving files in Jazz SCM repository

I need to write some standalone Java code for scanning the contents of files in a Jazz repository. Is there a simple Java library somewhere that allows access to files in a Jazz SCM repository? A simple OSGI plugin is fine, as long as it doesn't prereq any eclipse plugins.

I could just write a wrapper around the SCM CLI, but I'd like a solution that doesn't include the overhead of starting up a JVM for every command I issue.

In particular, I need to be able to...
    - List all workspaces in a repository for a given user.
    - List all components in a workspace.
    - List all files in a component or subdirectory (preferably one level at a time...not the entire tree, and also preferably including various meta-data such as last-modified timestamps and file sizes).
    - Retrieve the contents of a single file (preferrably as an input stream, not just copied to the local file system).
    - Retrieve the contents of all files in an entire component or subdirectory.


Any suggestions?

0 votes



3 answers

Permanent link
I need to write some standalone Java code for scanning the contents of files in a Jazz repository. Is there a simple Java library somewhere that allows access to files in a Jazz SCM repository? A simple OSGI plugin is fine, as long as it doesn't prereq any eclipse plugins.

I could just write a wrapper around the SCM CLI, but I'd like a solution that doesn't include the overhead of starting up a JVM for every command I issue.

In particular, I need to be able to...
    - List all workspaces in a repository for a given user.
    - List all components in a workspace.
    - List all files in a component or subdirectory (preferably one level at a time...not the entire tree, and also preferably including various meta-data such as last-modified timestamps and file sizes).
    - Retrieve the contents of a single file (preferrably as an input stream, not just copied to the local file system).
    - Retrieve the contents of all files in an entire component or subdirectory.


Any suggestions?
hello jbognar .. i just saw ur query even i am facing the same issue ...i am using a scm load command to load a workspace but i need some code in java api to load a workspace or component for me ...are u verse with any such api

with regards
Neerav

0 votes


Permanent link
Hi Neerav,

No, I have not received an answer to my question yet. Therefore, my assumption is that such a Java API does not exist.

I have postponed my work until a suitable solution becomes available.

0 votes


Permanent link
Hi Neerav,

No, I have not received an answer to my question yet. Therefore, my assumption is that such a Java API does not exist.

I have postponed my work until a suitable solution becomes available.



For question number1 (find workspaces)


String udc = "stream_name";
String ownerName = "admin_RTC";
IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
criteria = criteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
criteria.setExactOwnerName(ownerName);
//criteria = criteria.setExactName(udc);
List<IWorkspaceHandle> repwsList = wm.findWorkspaces(criteria, 100, null);
if (repwsList.size()==0) {
System.out.println("No WS"+udc+" was found.");
return false;
}
if (repwsList.size()>1) {
System.out.println("Found "+repwsList.size()+" Repository WS named "+udc+".");
return false;
}

IWorkspaceHandle repwsHan = repwsList.get(0);
IItemManager itemman = teamRepository.itemManager();
IWorkspace myWS= (IWorkspace) itemman.fetchCompleteItem(repwsHan, IItemManager.DEFAULT, null);



This should be the first brick...

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
× 11,079

Question asked: Apr 10 '10, 3:33 p.m.

Question was seen: 8,997 times

Last updated: Apr 10 '10, 3:33 p.m.

Confirmation Cancel Confirm