org.netbeans.modules.versioning.core/1 1.5.0 1

org.netbeans.modules.versioning.core.filesystems
Class VCSFilesystemInterceptor

java.lang.Object
  extended by org.netbeans.modules.versioning.core.filesystems.VCSFilesystemInterceptor

public final class VCSFilesystemInterceptor
extends Object

Entry point for calls from a filesystem.


Nested Class Summary
static interface VCSFilesystemInterceptor.IOHandler
          Handle to perform an I/O operation.
static class VCSFilesystemInterceptor.VCSAnnotationEvent
          Event describing a change in annotation of files.
static interface VCSFilesystemInterceptor.VCSAnnotationListener
          Listener for changes in annotations of files.
 
Method Summary
static Action[] actions(Set<? extends FileObject> files)
           
static void afterMove(VCSFileProxy from, VCSFileProxy to)
           
static Image annotateIcon(Image icon, int iconType, Set<? extends FileObject> files)
           
static String annotateNameHtml(String name, Set<? extends FileObject> files)
           
static void beforeChange(VCSFileProxy file)
           
static void beforeCopy(VCSFileProxy from, VCSFileProxy to)
           
static void beforeCreate(VCSFileProxy parent, String name, boolean isFolder)
           
static boolean canWriteReadonlyFile(VCSFileProxy file)
          Determines if the given file should be considered writable by the IDE even if it isn't in means of the relevant filesystem.
static void copySuccess(VCSFileProxy from, VCSFileProxy to)
           
static void createdExternally(VCSFileProxy file)
           
static void createFailure(VCSFileProxy parent, String name, boolean isFolder)
           
static void createSuccess(VCSFileProxy file)
           
static void deletedExternally(VCSFileProxy file)
           
static void deleteSuccess(VCSFileProxy file)
           
static void fileChanged(VCSFileProxy file)
           
static void fileLocked(VCSFileProxy fo)
          There is a contract that says that when a file is locked, it is expected to be changed.
static Object getAttribute(VCSFileProxy file, String attrName)
          Returns the given files files attribute
static VCSFilesystemInterceptor.IOHandler getCopyHandler(VCSFileProxy from, VCSFileProxy to)
           
static VCSFilesystemInterceptor.IOHandler getDeleteHandler(VCSFileProxy file)
           
static VCSFilesystemInterceptor.IOHandler getMoveHandler(VCSFileProxy from, VCSFileProxy to)
           
static VCSFilesystemInterceptor.IOHandler getRenameHandler(VCSFileProxy from, String newName)
           
static long listFiles(VCSFileProxy dir, long lastTimeStamp, List<? super VCSFileProxy> children)
           
static void registerFileStatusListener(VCSFilesystemInterceptor.VCSAnnotationListener listener)
          Listeners are held weakly, and can GC if nobody else holds them
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerFileStatusListener

public static void registerFileStatusListener(VCSFilesystemInterceptor.VCSAnnotationListener listener)
Listeners are held weakly, and can GC if nobody else holds them


annotateIcon

public static Image annotateIcon(Image icon,
                                 int iconType,
                                 Set<? extends FileObject> files)

annotateNameHtml

public static String annotateNameHtml(String name,
                                      Set<? extends FileObject> files)

actions

public static Action[] actions(Set<? extends FileObject> files)

canWriteReadonlyFile

public static boolean canWriteReadonlyFile(VCSFileProxy file)
Determines if the given file should be considered writable by the IDE even if it isn't in means of the relevant filesystem. Useful in cases when a file is locked by VCS but can be unlocked on write demand - e.g. by refactoring or editor access.

Parameters:
file -
Returns:
true if a relevant VCS system considers that the file should be handled as writable by the IDE, otherwise false.

getAttribute

public static Object getAttribute(VCSFileProxy file,
                                  String attrName)
Returns the given files files attribute

Parameters:
file -
attrName -
Returns:

beforeChange

public static void beforeChange(VCSFileProxy file)

fileChanged

public static void fileChanged(VCSFileProxy file)

getDeleteHandler

public static VCSFilesystemInterceptor.IOHandler getDeleteHandler(VCSFileProxy file)

deleteSuccess

public static void deleteSuccess(VCSFileProxy file)

deletedExternally

public static void deletedExternally(VCSFileProxy file)

beforeCreate

public static void beforeCreate(VCSFileProxy parent,
                                String name,
                                boolean isFolder)

createFailure

public static void createFailure(VCSFileProxy parent,
                                 String name,
                                 boolean isFolder)

createSuccess

public static void createSuccess(VCSFileProxy file)

createdExternally

public static void createdExternally(VCSFileProxy file)

getMoveHandler

public static VCSFilesystemInterceptor.IOHandler getMoveHandler(VCSFileProxy from,
                                                                VCSFileProxy to)

getRenameHandler

public static VCSFilesystemInterceptor.IOHandler getRenameHandler(VCSFileProxy from,
                                                                  String newName)

afterMove

public static void afterMove(VCSFileProxy from,
                             VCSFileProxy to)

getCopyHandler

public static VCSFilesystemInterceptor.IOHandler getCopyHandler(VCSFileProxy from,
                                                                VCSFileProxy to)

beforeCopy

public static void beforeCopy(VCSFileProxy from,
                              VCSFileProxy to)

copySuccess

public static void copySuccess(VCSFileProxy from,
                               VCSFileProxy to)

fileLocked

public static void fileLocked(VCSFileProxy fo)
                       throws IOException
There is a contract that says that when a file is locked, it is expected to be changed. This is what openide/text does when it creates a Document. A versioning system is expected to make the file r/w.

Parameters:
fo - a VCSFileProxy
Throws:
IOException

listFiles

public static long listFiles(VCSFileProxy dir,
                             long lastTimeStamp,
                             List<? super VCSFileProxy> children)

org.netbeans.modules.versioning.core/1 1.5.0 1

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.