public class DummyFileSystem extends DeprecatedVirtualFileSystem implements NonPhysicalFileSystem
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROTOCOL |
Constructor and Description |
---|
DummyFileSystem() |
Modifier and Type | Method and Description |
---|---|
VirtualFile |
createChildDirectory(java.lang.Object requestor,
VirtualFile vDir,
java.lang.String dirName)
Implementation of adding directories in this file system
|
VirtualFile |
createChildFile(java.lang.Object requestor,
VirtualFile vDir,
java.lang.String fileName)
Implementation of adding files in this file system
|
VirtualFile |
createRoot(java.lang.String name) |
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.
|
VirtualFile |
findFileByPath(java.lang.String path)
Searches for the file specified by given path.
|
void |
fireBeforeContentsChange(java.lang.Object requestor,
VirtualFile file) |
void |
fireContentsChanged(java.lang.Object requestor,
VirtualFile file,
long oldModificationStamp) |
static DummyFileSystem |
getInstance() |
java.lang.String |
getProtocol()
Gets the protocol for this file system.
|
void |
refresh(boolean asynchronous)
Refreshes the cached information for all files in this file system from the physical file system.
|
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. |
void |
renameFile(java.lang.Object requestor,
VirtualFile vFile,
java.lang.String newName)
Implementation of renaming files in this file system
|
addVirtualFileListener, assertWriteAccessAllowed, copyFile, fireBeforeFileDeletion, fireBeforeFileMovement, fireBeforePropertyChange, fireFileCopied, fireFileCreated, fireFileDeleted, fireFileMoved, firePropertyChanged, isReadOnly, moveFile, removeVirtualFileListener, startEventPropagation
isCaseSensitive, isValidName
public static final java.lang.String PROTOCOL
public static DummyFileSystem getInstance()
public VirtualFile createRoot(java.lang.String name)
public java.lang.String getProtocol()
VirtualFileSystem
KeyedLazyInstanceEP.key
.getProtocol
in class VirtualFileSystem
VirtualFile.getUrl()
,
VirtualFileManager.getFileSystem(java.lang.String)
public VirtualFile findFileByPath(java.lang.String path)
VirtualFileSystem
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).findFileByPath
in class VirtualFileSystem
path
- the path to find file bynull
otherwisepublic java.lang.String extractPresentableUrl(java.lang.String path)
VirtualFileSystem
extractPresentableUrl
in class VirtualFileSystem
path
- the path to get presentable URL forVirtualFile.getPresentableUrl()
public void refresh(boolean asynchronous)
VirtualFileSystem
If
asynchronous
is false
this method should be only called within write-action.
See Application.runWriteAction(java.lang.Runnable)
.refresh
in class VirtualFileSystem
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 VirtualFile refreshAndFindFileByPath(java.lang.String path)
VirtualFileSystem
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.
refreshAndFindFileByPath
in class VirtualFileSystem
path
- the pathVirtualFile
if the file was found, null
otherwisepublic void deleteFile(java.lang.Object requestor, VirtualFile vFile) throws java.io.IOException
VirtualFileSystem
deleteFile
in class DeprecatedVirtualFileSystem
java.io.IOException
VirtualFile.delete(Object)
public void renameFile(java.lang.Object requestor, VirtualFile vFile, java.lang.String newName)
VirtualFileSystem
renameFile
in class DeprecatedVirtualFileSystem
VirtualFile.rename(Object,String)
public VirtualFile createChildFile(java.lang.Object requestor, VirtualFile vDir, java.lang.String fileName) throws java.io.IOException
VirtualFileSystem
createChildFile
in class DeprecatedVirtualFileSystem
java.io.IOException
VirtualFile.createChildData(Object,String)
public void fireBeforeContentsChange(java.lang.Object requestor, VirtualFile file)
fireBeforeContentsChange
in class DeprecatedVirtualFileSystem
public void fireContentsChanged(java.lang.Object requestor, VirtualFile file, long oldModificationStamp)
fireContentsChanged
in class DeprecatedVirtualFileSystem
public VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile vDir, java.lang.String dirName)
VirtualFileSystem
createChildDirectory
in class DeprecatedVirtualFileSystem
VirtualFile.createChildDirectory(Object,String)