LocalFileOperationsHandler question

Hi, I want to ask if some operation from LocalFileOperationsHandler for e.g. rename is overridden, then I can see that if it returns true - file is renamed, and if it return false the file is also renamed. I wonder how can I cause the file not to be renamed with this operation overridden.

Thanks

2 comments
Comment actions Permalink

Hello ALincoln,

Hi, I want to ask if some operation from LocalFileOperationsHandler
for e.g. rename is overridden, then I can see that if it returns true
- file is renamed, and if it return false the file is also renamed. I
wonder how can I cause the file not to be renamed with this operation
overridden.


If you return true and do not rename the file in your handler, it should
not be actually renamed.

Note that blocking rename operations on such a low level can cause many things
to break (for example, if the user renames a Java class and you block the
renaming of the file, the end result will be quite confusing).

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,
I've tried to rename file, and I made my method to return true. The file is not actually renamed. But as I see it is renamed on virtual file system... Because I'm being shown new file's name and after performing a refresh, file's name is changed to previous. Am I right? How can I avoid that? Should I change the implementation of overridden methods that belong to VirtualFileAdapter?

Edited by: ALincoln on Jun 16, 2008 8:24 PM

0

Please sign in to leave a comment.