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, |
One answer
You can just check if IVersionableHandle is IFileItemHandle.
if (item instanceof IFileItemHandle) { .... } |
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.