public abstract class NewVirtualFileSystem extends VirtualFileSystem implements FileSystemInterface, CachingVirtualFileSystem
DEFAULT_LENGTH, DEFAULT_TIMESTAMP| Constructor and Description |
|---|
NewVirtualFileSystem() |
| Modifier and Type | Method and Description |
|---|---|
void |
addVirtualFileListener(VirtualFileListener listener)
Adds listener to the file system.
|
abstract VirtualFile |
copyFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent,
java.lang.String copyName)
Implementation of copying files in this file system
|
abstract VirtualFile |
createChildDirectory(java.lang.Object requestor,
VirtualFile parent,
java.lang.String dir)
Implementation of adding directories in this file system
|
abstract VirtualFile |
createChildFile(java.lang.Object requestor,
VirtualFile parent,
java.lang.String file)
Implementation of adding files in this file system
|
abstract void |
deleteFile(java.lang.Object requestor,
VirtualFile file)
Implementation of deleting files in this file system
|
protected abstract java.lang.String |
extractRootPath(java.lang.String normalizedPath)
IntelliJ platform calls this method with non-null value returned by
normalize(java.lang.String), but if something went wrong
and an implementation can't extract a valid root path nevertheless, it should return an empty string. |
abstract VirtualFile |
findFileByPathIfCached(java.lang.String path) |
abstract FileAttributes |
getAttributes(VirtualFile file)
Reads various file attributes in one shot (to reduce the number of native I/O calls).
|
java.lang.String |
getCanonicallyCasedName(VirtualFile file) |
abstract int |
getRank() |
boolean |
hasChildren(VirtualFile file)
Returns
true if path represents a directory with at least one child. |
boolean |
isReadOnly() |
boolean |
isSymLink(VirtualFile file) |
boolean |
markNewFilesAsDirty() |
abstract void |
moveFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent)
Implementation of moving files in this file system
|
protected java.lang.String |
normalize(java.lang.String path)
Implementations should convert separator chars to forward slashes and remove duplicates ones,
and convert paths to "absolute" form (so that they start from a root that is valid for this FS and
could be later extracted with
extractRootPath(java.lang.String)). |
void |
refreshWithoutFileWatcher(boolean asynchronous) |
void |
removeVirtualFileListener(VirtualFileListener listener)
Removes listener form the file system.
|
abstract void |
renameFile(java.lang.Object requestor,
VirtualFile file,
java.lang.String newName)
Implementation of renaming files in this file system
|
java.lang.String |
resolveSymLink(VirtualFile file) |
extractPresentableUrl, findFileByPath, getProtocol, isCaseSensitive, isValidName, refresh, refreshAndFindFileByPathclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontentsToByteArray, exists, getInputStream, getLength, getOutputStream, getTimeStamp, isDirectory, isWritable, list, setTimeStamp, setWritableprotected java.lang.String normalize(java.lang.String path)
Implementations should convert separator chars to forward slashes and remove duplicates ones,
and convert paths to "absolute" form (so that they start from a root that is valid for this FS and
could be later extracted with extractRootPath(java.lang.String)).
Implementations should not normalize paths by eliminating directory traversals or other indirections.
null when a path is invalid for this FS.protected abstract java.lang.String extractRootPath(java.lang.String normalizedPath)
normalize(java.lang.String), but if something went wrong
and an implementation can't extract a valid root path nevertheless, it should return an empty string.public abstract VirtualFile findFileByPathIfCached(java.lang.String path)
public void refreshWithoutFileWatcher(boolean asynchronous)
refreshWithoutFileWatcher in interface CachingVirtualFileSystempublic boolean isReadOnly()
isReadOnly in class VirtualFileSystempublic boolean isSymLink(VirtualFile file)
isSymLink in interface FileSystemInterfacepublic java.lang.String resolveSymLink(VirtualFile file)
resolveSymLink in interface FileSystemInterfacepublic void addVirtualFileListener(VirtualFileListener listener)
VirtualFileSystemVirtualFileManager.VFS_CHANGES message bus topic.addVirtualFileListener in class VirtualFileSystemlistener - the listenerVirtualFileListener,
VirtualFileManager.VFS_CHANGESpublic void removeVirtualFileListener(VirtualFileListener listener)
VirtualFileSystemremoveVirtualFileListener in class VirtualFileSystemlistener - the listenerpublic abstract int getRank()
public abstract VirtualFile copyFile(java.lang.Object requestor, VirtualFile file, VirtualFile newParent, java.lang.String copyName) throws java.io.IOException
VirtualFileSystemcopyFile in interface FileSystemInterfacecopyFile in class VirtualFileSystemjava.io.IOExceptionVirtualFile.copy(Object,VirtualFile,String)public abstract VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile parent, java.lang.String dir) throws java.io.IOException
VirtualFileSystemcreateChildDirectory in interface FileSystemInterfacecreateChildDirectory in class VirtualFileSystemjava.io.IOExceptionVirtualFile.createChildDirectory(Object,String)public abstract VirtualFile createChildFile(java.lang.Object requestor, VirtualFile parent, java.lang.String file) throws java.io.IOException
VirtualFileSystemcreateChildFile in interface FileSystemInterfacecreateChildFile in class VirtualFileSystemjava.io.IOExceptionVirtualFile.createChildData(Object,String)public abstract void deleteFile(java.lang.Object requestor,
VirtualFile file)
throws java.io.IOException
VirtualFileSystemdeleteFile in interface FileSystemInterfacedeleteFile in class VirtualFileSystemjava.io.IOExceptionVirtualFile.delete(Object)public abstract void moveFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent)
throws java.io.IOException
VirtualFileSystemmoveFile in interface FileSystemInterfacemoveFile in class VirtualFileSystemjava.io.IOExceptionVirtualFile.move(Object,VirtualFile)public abstract void renameFile(java.lang.Object requestor,
VirtualFile file,
java.lang.String newName)
throws java.io.IOException
VirtualFileSystemrenameFile in interface FileSystemInterfacerenameFile in class VirtualFileSystemjava.io.IOExceptionVirtualFile.rename(Object,String)public boolean markNewFilesAsDirty()
public java.lang.String getCanonicallyCasedName(VirtualFile file)
public abstract FileAttributes getAttributes(VirtualFile file)
file - file to get attributes of.null if the file doesn't exist.public boolean hasChildren(VirtualFile file)
true if path represents a directory with at least one child.
Override if your file system can answer this question more efficiently (e.g. without enumerating all children).