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

Getting a file info through a plain Java API.

Hello,

My customer needs a list of all file's info in a specific project-steam-workspace.
#because of compliance reqson...

Here, " file's info" consist of...
- path (*Windows directory name is OK)
- filename
- a latest date which modified
- who modified last

Platform :Windows 7, RTC and Plain Java API lib are 3.0.1.2.

I try to get these info through the plain Java API. I refered the sample code "Snippet4.java"(contained in a distribution of the plain Java API), and modified Snippet4.printComponentFileTree() method.

///////// part of a modified-Snippet4.printComponentFileTree()
for (String name : children.keySet()) {
IVersionableHandle item = children.get(name);
if(item instanceof IFolderHandle){
printComponentFileTree(workspace, component, configuration, (IFolderHandle)item, indent + " ", monitor);
}else{
monitor.subTask(indent + name);
// How do I get info of each file ????
//
}
}
/////////////////////

I can get an instance of IVersionableHandle, but don't know how to access a each file and get info listed above.

If someone know how to do that,please give me advise.

regards,

0 votes



One answer

Permanent link
You can just check if IVersionableHandle is IFileItemHandle.

if (item instanceof IFileItemHandle)
{
   ....
}

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
× 10,941

Question asked: Mar 22 '12, 10:41 p.m.

Question was seen: 6,285 times

Last updated: Jul 01 '12, 7:34 a.m.

Confirmation Cancel Confirm