|Howto observe external folder with IResourceChangeListener [message #699818]
||Fri, 22 July 2011 11:30
| T. Wilhelm
Registered: December 2010
Hi all, |
i have a question about the IResourceChangeListener. I want to observe a special folder which is not located in my workspace. Is that possible? Can i do that with IResourceChangeListener? I tried it already, but wasn´t really successful. I found a solution which first creates a project within the workspace, then creates a link to the external folder and that seems to work, but thats solution is not really nice.
Here is my code (without the link solution) , any idea whats wrong or why my resourceChanged() method is never been called? Thanks a lot!
IWorkspace workspace = ResourcesPlugin.getWorkspace();
workspace.addResourceChangeListener( this );
IPathVariableManager pathManager = workspace.getPathVariableManager();
this.path = new Path( "c:/temp/folderToObserve");
URI uri = this.path.toFile().toURI();
if ( pathManager.validateName( "myName" ).isOK() && pathManager.validateValue( value ).isOK() )
pathManager.setURIValue( "myName", uri );
Powered by FUDForum
. Page generated in 0.01734 seconds