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, refreshAndFindFileByPath
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contentsToByteArray, exists, getInputStream, getLength, getOutputStream, getTimeStamp, isDirectory, isWritable, list, setTimeStamp, setWritable
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)
).
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 CachingVirtualFileSystem
public boolean isReadOnly()
isReadOnly
in class VirtualFileSystem
public boolean isSymLink(VirtualFile file)
isSymLink
in interface FileSystemInterface
public java.lang.String resolveSymLink(VirtualFile file)
resolveSymLink
in interface FileSystemInterface
public void addVirtualFileListener(VirtualFileListener listener)
VirtualFileSystem
VirtualFileManager.VFS_CHANGES
message bus topic.addVirtualFileListener
in class VirtualFileSystem
listener
- the listenerVirtualFileListener
,
VirtualFileManager.VFS_CHANGES
public void removeVirtualFileListener(VirtualFileListener listener)
VirtualFileSystem
removeVirtualFileListener
in class VirtualFileSystem
listener
- 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
VirtualFileSystem
copyFile
in interface FileSystemInterface
copyFile
in class VirtualFileSystem
java.io.IOException
VirtualFile.copy(Object,VirtualFile,String)
public abstract VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile parent, java.lang.String dir) throws java.io.IOException
VirtualFileSystem
createChildDirectory
in interface FileSystemInterface
createChildDirectory
in class VirtualFileSystem
java.io.IOException
VirtualFile.createChildDirectory(Object,String)
public abstract VirtualFile createChildFile(java.lang.Object requestor, VirtualFile parent, java.lang.String file) throws java.io.IOException
VirtualFileSystem
createChildFile
in interface FileSystemInterface
createChildFile
in class VirtualFileSystem
java.io.IOException
VirtualFile.createChildData(Object,String)
public abstract void deleteFile(java.lang.Object requestor, VirtualFile file) throws java.io.IOException
VirtualFileSystem
deleteFile
in interface FileSystemInterface
deleteFile
in class VirtualFileSystem
java.io.IOException
VirtualFile.delete(Object)
public abstract void moveFile(java.lang.Object requestor, VirtualFile file, VirtualFile newParent) throws java.io.IOException
VirtualFileSystem
moveFile
in interface FileSystemInterface
moveFile
in class VirtualFileSystem
java.io.IOException
VirtualFile.move(Object,VirtualFile)
public abstract void renameFile(java.lang.Object requestor, VirtualFile file, java.lang.String newName) throws java.io.IOException
VirtualFileSystem
renameFile
in interface FileSystemInterface
renameFile
in class VirtualFileSystem
java.io.IOException
VirtualFile.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).