com.togethersoft.openapi.vfs
Interface VirtualFileErrorUI


public interface VirtualFileErrorUI

This interface is used to define behaviour of VFS in a number of conflict situations. Implementation of
VirtualFileErrorUI is supposed to interact with user by some mean to let him make a decision.
See setErrorUI and getErrorUI methods of VirtualFileManager.

Author:
TogetherSoft

Method Summary
 booleanisKeepModified(VirtualFile file)
          Called when the system during cache synchronization process encounters a
file with cached contents which was deleted by external process.
 booleanisOverwriteModified(VirtualFile file)
          Called when the system during saving caches encounters a file with timestamp
set differently than the cached timestamp.
 booleanisReloadModified(VirtualFile file)
          Called when the system during cache synchronization process encounters a
file timestamp different from cached timestamp and only if this file
has cached contents.
 booleanisRetryFailedRead(VirtualFile file)
          Called when an attempt to read from specified file has failed.
 booleanisRetryFailedWrite(VirtualFile file)
          Called when an attempt to write to specified file has failed.

Method Detail

isKeepModified

public boolean isKeepModified(VirtualFile file)
Called when the system during cache synchronization process encounters a
file with cached contents which was deleted by external process. Return
true to file in cache file, false to delete. If kept in cache the file will be saved on disk on next synchronization.
Returns: true to keep file in cache, false to delete

isOverwriteModified

public boolean isOverwriteModified(VirtualFile file)
Called when the system during saving caches encounters a file with timestamp
set differently than the cached timestamp. Return true to overwrite the
file on disk with cached contents. Return false to skip this file
overwrite, thus nothing is done and this method will be called on next save cache operation.
Returns: true to force overwrite, false to skip the file

isReloadModified

public boolean isReloadModified(VirtualFile file)
Called when the system during cache synchronization process encounters a
file timestamp different from cached timestamp and only if this file
has cached contents. Return true to force reload file, false to skip reloading the file, thus saving cached contents,
Returns: true to force reload, false to skip

isRetryFailedRead

public boolean isRetryFailedRead(VirtualFile file)
throws java.io.InterruptedIOException
Called when an attempt to read from specified file has failed. Return false
if the user wishes to retry the operation, false to ignore. Throw InterruptedIOException to cancel the whole process.
Returns: true if the user wishes to retry the operation, false to ignore

isRetryFailedWrite

public boolean isRetryFailedWrite(VirtualFile file)
throws java.io.InterruptedIOException
Called when an attempt to write to specified file has failed. Return true
if the user wishes to retry the operation, false to ignore. Throw InterruptedIOException to cancel the whole process.
Returns: true if the user wishes to retry the operation, false to ignore