public abstract class VirtualFileSystem
extends java.lang.Object
See Virtual File System (SDK docs).
VirtualFile
,
VirtualFileManager
Modifier | Constructor and Description |
---|---|
protected |
VirtualFileSystem() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addVirtualFileListener(VirtualFileListener listener)
Adds listener to the file system.
|
protected abstract VirtualFile |
copyFile(java.lang.Object requestor,
VirtualFile virtualFile,
VirtualFile newParent,
java.lang.String copyName)
Implementation of copying files in this file system
|
protected abstract VirtualFile |
createChildDirectory(java.lang.Object requestor,
VirtualFile vDir,
java.lang.String dirName)
Implementation of adding directories in this file system
|
protected abstract VirtualFile |
createChildFile(java.lang.Object requestor,
VirtualFile vDir,
java.lang.String fileName)
Implementation of adding files in this file system
|
protected abstract void |
deleteFile(java.lang.Object requestor,
VirtualFile vFile)
Implementation of deleting files in this file system
|
java.lang.String |
extractPresentableUrl(java.lang.String path)
Fetches presentable URL of file with the given path in this file system.
|
abstract VirtualFile |
findFileByPath(java.lang.String path)
Searches for the file specified by given path.
|
abstract java.lang.String |
getProtocol()
Gets the protocol for this file system.
|
boolean |
isCaseSensitive() |
abstract boolean |
isReadOnly() |
boolean |
isValidName(java.lang.String name) |
protected abstract void |
moveFile(java.lang.Object requestor,
VirtualFile vFile,
VirtualFile newParent)
Implementation of moving files in this file system
|
abstract void |
refresh(boolean asynchronous)
Refreshes the cached information for all files in this file system from the physical file system.
|
abstract VirtualFile |
refreshAndFindFileByPath(java.lang.String path)
Refreshes only the part of the file system needed for searching the file by the given path and finds file
by the given path.
This method is useful when the file was created externally and you need to find
corresponding to it. |
abstract void |
removeVirtualFileListener(VirtualFileListener listener)
Removes listener form the file system.
|
protected abstract void |
renameFile(java.lang.Object requestor,
VirtualFile vFile,
java.lang.String newName)
Implementation of renaming files in this file system
|
public abstract java.lang.String getProtocol()
KeyedLazyInstanceEP.key
.VirtualFile.getUrl()
,
VirtualFileManager.getFileSystem(java.lang.String)
public abstract VirtualFile findFileByPath(java.lang.String path)
VirtualFileSystem
. Format of the path depends on the concrete file system.
For LocalFileSystem
it is an absolute path (both Unix- and Windows-style separator chars are allowed).path
- the path to find file bynull
otherwisepublic java.lang.String extractPresentableUrl(java.lang.String path)
path
- the path to get presentable URL forVirtualFile.getPresentableUrl()
public abstract void refresh(boolean asynchronous)
If
asynchronous
is false
this method should be only called within write-action.
See Application.runWriteAction(java.lang.Runnable)
.asynchronous
- if true
then the operation will be performed in a separate thread,
otherwise will be performed immediatelyVirtualFile.refresh(boolean, boolean)
,
VirtualFileManager.syncRefresh()
,
VirtualFileManager.asyncRefresh(java.lang.Runnable)
public abstract VirtualFile refreshAndFindFileByPath(java.lang.String path)
VirtualFile
corresponding to it.If this method is invoked not from Swing event dispatch thread, then it must not happen inside a read action. The reason is that then the method call won't return until proper VFS events are fired, which happens on Swing thread and in write action. So invoking this method in a read action would result in a deadlock.
path
- the pathVirtualFile
if the file was found, null
otherwisepublic abstract void addVirtualFileListener(VirtualFileListener listener)
VirtualFileManager.VFS_CHANGES
message bus topic.listener
- the listenerVirtualFileListener
,
VirtualFileManager.VFS_CHANGES
public abstract void removeVirtualFileListener(VirtualFileListener listener)
listener
- the listenerprotected abstract void deleteFile(java.lang.Object requestor, VirtualFile vFile) throws java.io.IOException
java.io.IOException
VirtualFile.delete(Object)
protected abstract void moveFile(java.lang.Object requestor, VirtualFile vFile, VirtualFile newParent) throws java.io.IOException
java.io.IOException
VirtualFile.move(Object,VirtualFile)
protected abstract void renameFile(java.lang.Object requestor, VirtualFile vFile, java.lang.String newName) throws java.io.IOException
java.io.IOException
VirtualFile.rename(Object,String)
protected abstract VirtualFile createChildFile(java.lang.Object requestor, VirtualFile vDir, java.lang.String fileName) throws java.io.IOException
java.io.IOException
VirtualFile.createChildData(Object,String)
protected abstract VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile vDir, java.lang.String dirName) throws java.io.IOException
java.io.IOException
VirtualFile.createChildDirectory(Object,String)
protected abstract VirtualFile copyFile(java.lang.Object requestor, VirtualFile virtualFile, VirtualFile newParent, java.lang.String copyName) throws java.io.IOException
java.io.IOException
VirtualFile.copy(Object,VirtualFile,String)
public abstract boolean isReadOnly()
public boolean isCaseSensitive()
public boolean isValidName(java.lang.String name)