public class StubVirtualFile extends VirtualFile
VirtualFile.PropNameEMPTY_ARRAY, PROP_ENCODING, PROP_HIDDEN, PROP_NAME, PROP_SYMLINK_TARGET, PROP_WRITABLEEVER_CHANGED, NEVER_CHANGED| Constructor and Description | 
|---|
StubVirtualFile()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
clearUserData()  | 
byte [] | 
contentsToByteArray()
Returns file content as an array of bytes. 
 | 
VirtualFile | 
copy(java.lang.Object requestor,
    VirtualFile newParent,
    java.lang.String copyName)  | 
VirtualFile | 
createChildData(java.lang.Object requestor,
               java.lang.String name)
Creates a new file in this directory. 
 | 
VirtualFile | 
createChildDirectory(java.lang.Object requestor,
                    java.lang.String name)
Creates a subdirectory in this directory. 
 | 
void | 
delete(java.lang.Object requestor)
Deletes this file. 
 | 
VirtualFile[] | 
getChildren()
Gets the child files. 
 | 
VirtualFileSystem | 
getFileSystem()
Gets the  
VirtualFileSystem this file belongs to. | 
java.io.InputStream | 
getInputStream()
Gets the  
InputStream for this file. | 
long | 
getLength()
File length in bytes. 
 | 
java.lang.String | 
getName()
Gets the name of this file. 
 | 
java.io.OutputStream | 
getOutputStream(java.lang.Object requestor,
               long newModificationStamp,
               long newTimeStamp)
Gets the  
OutputStream for this file and sets modification stamp and time stamp to the specified values
 after closing the stream. | 
VirtualFile | 
getParent()
Gets the parent  
VirtualFile. | 
java.lang.String | 
getPath()
Gets the path of this file. 
 | 
long | 
getTimeStamp()
Gets the timestamp for this file. 
 | 
java.lang.String | 
getUrl()
Returns the URL of this file. 
 | 
boolean | 
isDirectory()
Checks whether this file is a directory. 
 | 
boolean | 
isValid()
Checks whether this  
VirtualFile is valid. | 
boolean | 
isWritable()
Checks whether this file could be modified. 
 | 
void | 
move(java.lang.Object requestor,
    VirtualFile newParent)
Moves this file to another directory. 
 | 
<T> void | 
putCopyableUserData(Key<T> key,
                   T value)  | 
<T> void | 
putUserData(Key<T> key,
           T value)
Add a new user data value to this object. 
 | 
<T> T | 
putUserDataIfAbsent(Key<T> key,
                   T value)  | 
void | 
refresh(boolean asynchronous,
       boolean recursive)
Refreshes the cached file information from the physical file system. 
 | 
void | 
refresh(boolean asynchronous,
       boolean recursive,
       java.lang.Runnable postRunnable)
The same as  
VirtualFile.refresh(boolean, boolean) but also runs postRunnable
 after the operation is completed. | 
<T> boolean | 
replace(Key<T> key,
       T oldValue,
       T newValue)
Replaces (atomically) old value in the map with the new one 
 | 
void | 
setBinaryContent(byte [] content,
                long newModificationStamp,
                long newTimeStamp)  | 
void | 
setBinaryContent(byte [] content,
                long newModificationStamp,
                long newTimeStamp,
                java.lang.Object requestor)  | 
void | 
setBOM(byte [] BOM)  | 
void | 
setCharset(java.nio.charset.Charset charset)  | 
void | 
setCharset(java.nio.charset.Charset charset,
          java.lang.Runnable whenChanged)  | 
void | 
setCharset(java.nio.charset.Charset charset,
          java.lang.Runnable whenChanged,
          boolean fireEventsWhenChanged)  | 
void | 
setDetectedLineSeparator(java.lang.String separator)  | 
void | 
setPreloadedContentHint(byte[] preloadedContentHint)  | 
protected void | 
setUserMap(KeyFMap map)  | 
void | 
setWritable(boolean writable)  | 
protected void | 
storeCharset(java.nio.charset.Charset charset)  | 
contentsToByteArray, exists, findChild, findFileByRelativePath, findOrCreateChildData, getBOM, getCanonicalFile, getCanonicalPath, getCharset, getDetectedLineSeparator, getExtension, getFileType, getModificationCount, getModificationStamp, getNameSequence, getNameWithoutExtension, getOutputStream, getPresentableName, getPresentableUrl, is, isCharsetSet, isInLocalFileSystem, isRecursiveOrCircularSymLink, isValidName, nameEquals, rename, setBinaryContent, toStringchangeUserMap, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmptypublic byte [] contentsToByteArray()
                            throws java.io.IOException
VirtualFilecontentsToByteArray in class VirtualFilejava.io.IOException - if an I/O error occursVirtualFile.contentsToByteArray(boolean), 
VirtualFile.getInputStream()public VirtualFile[] getChildren()
VirtualFilegetChildren in class VirtualFilenull if this file is not a directorypublic VirtualFileSystem getFileSystem()
VirtualFileVirtualFileSystem this file belongs to.getFileSystem in class VirtualFileVirtualFileSystempublic java.io.InputStream getInputStream()
                                   throws java.io.IOException
VirtualFileInputStream for this file.
 Skips BOM if there is any. See Unicode Byte Order Mark FAQ for an explanation.getInputStream in class VirtualFileInputStreamjava.io.IOException - if an I/O error occursVirtualFile.contentsToByteArray()public long getLength()
VirtualFilegetLength in class VirtualFilepublic java.lang.String getName()
VirtualFilegetName in class VirtualFileVirtualFile.getNameSequence()public java.io.OutputStream getOutputStream(java.lang.Object requestor,
                                            long newModificationStamp,
                                            long newTimeStamp)
                                     throws java.io.IOException
VirtualFileGets the OutputStream for this file and sets modification stamp and time stamp to the specified values
 after closing the stream.
Normally, you should not use this method.
Writes BOM first, if there is any. See Unicode Byte Order Mark FAQ for an explanation.
getOutputStream in class VirtualFilerequestor - any object to control who called this method. Note that
                             it is considered to be an external change if requestor is null.
                             See VirtualFileEvent.getRequestor() and SafeWriteRequestor.newModificationStamp - new modification stamp or -1 if no special value should be setnewTimeStamp - new time stamp or -1 if no special value should be setOutputStreamjava.io.IOException - if an I/O error occursVirtualFile.getModificationStamp()public VirtualFile getParent()
VirtualFileVirtualFile.getParent in class VirtualFilenull if this file is a root directorypublic java.lang.String getPath()
VirtualFileVirtualFileSystem. Format of the path depends on the concrete file system.
 For LocalFileSystem it is an absolute file path with file separator characters
 (File.separatorChar) replaced to the forward slash ('/').getPath in class VirtualFilepublic long getTimeStamp()
VirtualFilegetTimeStamp in class VirtualFileFile.lastModified()public java.lang.String getUrl()
VirtualFileReturns the URL of this file. The URL is a string that uniquely identifies a file in all file systems.
 It has the following format: <protocol>://<path>.
File can be found by its URL using VirtualFileManager.findFileByUrl(java.lang.String) method.
Please note these URLs are intended for use withing VFS - meaning they are not necessarily RFC-compliant.
getUrl in class VirtualFileVirtualFileManager.findFileByUrl(java.lang.String), 
VirtualFile.getPath(), 
VirtualFileSystem.getProtocol()public boolean isDirectory()
VirtualFileisDirectory in class VirtualFiletrue if this file is a directory, false otherwisepublic boolean isValid()
VirtualFileVirtualFile is valid. File can be invalidated either by deleting it or one of its
 parents with VirtualFile.delete(java.lang.Object) method or by an external change.
 If file is not valid only Object.equals(java.lang.Object), Object.hashCode(),
 VirtualFile.getName(), VirtualFile.getPath(), VirtualFile.getUrl(), VirtualFile.getPresentableUrl() and methods from
 UserDataHolder can be called for it. Using any other methods for an invalid VirtualFile instance
 produce unpredictable results.isValid in class VirtualFiletrue if this is a valid file, false otherwisepublic boolean isWritable()
VirtualFileisWritable in class VirtualFiletrue if this file is writable, false otherwisepublic void refresh(boolean asynchronous,
                    boolean recursive,
                    java.lang.Runnable postRunnable)
VirtualFileVirtualFile.refresh(boolean, boolean) but also runs postRunnable
 after the operation is completed. The runnable is executed on event dispatch thread inside write action.refresh in class VirtualFilepublic void setWritable(boolean writable)
setWritable in class VirtualFilepublic VirtualFile createChildDirectory(java.lang.Object requestor, java.lang.String name)
VirtualFileApplication.runWriteAction(java.lang.Runnable).createChildDirectory in class VirtualFilerequestor - any object to control who called this method. Note that
                  it is considered to be an external change if requestor is null.
                  See VirtualFileEvent.getRequestor()name - directory nameVirtualFile representing the created directorypublic VirtualFile createChildData(java.lang.Object requestor, java.lang.String name)
VirtualFileApplication.runWriteAction(java.lang.Runnable).createChildData in class VirtualFilerequestor - any object to control who called this method. Note that
                  it is considered to be an external change if requestor is null.
                  See VirtualFileEvent.getRequestor()VirtualFile representing the created filepublic void delete(java.lang.Object requestor)
VirtualFileApplication.runWriteAction(java.lang.Runnable).delete in class VirtualFilerequestor - any object to control who called this method. Note that
                  it is considered to be an external change if requestor is null.
                  See VirtualFileEvent.getRequestor()public void move(java.lang.Object requestor,
                 VirtualFile newParent)
VirtualFileApplication.runWriteAction(java.lang.Runnable).move in class VirtualFilerequestor - any object to control who called this method. Note that
                  it is considered to be an external change if requestor is null.
                  See VirtualFileEvent.getRequestor()newParent - the directory to move this file topublic VirtualFile copy(java.lang.Object requestor, VirtualFile newParent, java.lang.String copyName)
copy in class VirtualFileprotected void storeCharset(java.nio.charset.Charset charset)
storeCharset in class VirtualFilepublic void setCharset(java.nio.charset.Charset charset)
setCharset in class VirtualFilepublic void setCharset(java.nio.charset.Charset charset,
                       java.lang.Runnable whenChanged)
setCharset in class VirtualFilepublic void setCharset(java.nio.charset.Charset charset,
                       java.lang.Runnable whenChanged,
                       boolean fireEventsWhenChanged)
setCharset in class VirtualFilepublic void setBinaryContent(byte [] content,
                             long newModificationStamp,
                             long newTimeStamp)
setBinaryContent in class VirtualFilepublic void setBinaryContent(byte [] content,
                             long newModificationStamp,
                             long newTimeStamp,
                             java.lang.Object requestor)
setBinaryContent in class VirtualFilepublic void refresh(boolean asynchronous,
                    boolean recursive)
VirtualFileRefreshes the cached file information from the physical file system. If this file is not a directory
 the timestamp value is refreshed and contentsChanged event is fired if it is changed.
 If this file is a directory the set of its children is refreshed. If recursive value is true all
 children are refreshed recursively.
When invoking synchronous refresh from a thread other than the event dispatch thread, the current thread must NOT be in a read action, otherwise a deadlock may occur.
refresh in class VirtualFileasynchronous - if true, the method will return immediately and the refresh will be processed
                     in the background. If false, the method will return only after the refresh
                     is done and the VFS change events caused by the refresh have been fired and processed
                     in the event dispatch thread. Instead of synchronous refreshes, it's recommended to use
                     asynchronous refreshes with a postRunnable whenever possible.recursive - whether to refresh all the files in this directory recursivelypublic void setBOM(byte [] BOM)
setBOM in class VirtualFilepublic void setDetectedLineSeparator(java.lang.String separator)
setDetectedLineSeparator in class VirtualFilepublic void setPreloadedContentHint(byte[] preloadedContentHint)
setPreloadedContentHint in class VirtualFilepublic <T> void putUserData(Key<T> key, T value)
UserDataHolderputUserData in interface UserDataHolderputUserData in class UserDataHolderBasepublic <T> void putCopyableUserData(Key<T> key, T value)
putCopyableUserData in class UserDataHolderBasepublic <T> boolean replace(Key<T> key, T oldValue, T newValue)
UserDataHolderExreplace in interface UserDataHolderExreplace in class UserDataHolderBaseConcurrentMap.replace(Object, Object, Object)public <T> T putUserDataIfAbsent(Key<T> key, T value)
putUserDataIfAbsent in interface UserDataHolderExputUserDataIfAbsent in class UserDataHolderBaseprotected void clearUserData()
clearUserData in class UserDataHolderBaseprotected void setUserMap(KeyFMap map)
setUserMap in class UserDataHolderBase