I am developing an activity tracker for my development work in Eclipse (with Java). I now have the program's path and the duration i spent in it.
e.g.: 7min C:\Program Files (x86)\Internet Explorer\iexplore.exe
and
10min C:\Program Files\Microsoft Office\Office14\OUTLOOK.EXE
I now want to know the name of the program. In C# I get it like this:
System.Diagnostics.FileVersionInfo versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(file);
return (versionInfo.FileDescription == string.Empty) ? null : versionInfo.FileDescription;
Unfortunately, I found no such way in Java and i am not sure if this is even possible?
Thank you!
Edit: I also read this post and the accepted answer but was unable to get the FileDescription...
I am not aware of such API in Java. However, what you can do is as follows:
(I would suggest you to consider whether you absolutely need this description.) Good luck!