public abstract class VirtualFileManager extends java.lang.Object implements ModificationTracker
VirtualFileSystem
Modifier and Type | Field and Description |
---|---|
static Topic<BulkFileListener> |
VFS_CHANGES |
static ModificationTracker |
VFS_STRUCTURE_MODIFICATIONS |
EVER_CHANGED, NEVER_CHANGED
Constructor and Description |
---|
VirtualFileManager() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addAsyncFileListener(AsyncFileListener listener,
Disposable parentDisposable)
Consider using extension point
vfs.asyncListener . |
abstract void |
addVirtualFileListener(VirtualFileListener listener)
Deprecated.
Use
VFS_CHANGES message bus topic. |
abstract void |
addVirtualFileListener(VirtualFileListener listener,
Disposable parentDisposable)
Deprecated.
Use
VFS_CHANGES message bus topic. |
abstract void |
addVirtualFileManagerListener(VirtualFileManagerListener listener) |
abstract void |
addVirtualFileManagerListener(VirtualFileManagerListener listener,
Disposable parentDisposable) |
abstract long |
asyncRefresh(java.lang.Runnable postAction)
Refreshes the cached file systems information from the physical file systems asynchronously.
|
static java.lang.String |
constructUrl(java.lang.String protocol,
java.lang.String path)
Constructs a
URL by specified protocol and path. |
static java.lang.String |
extractPath(java.lang.String url)
Extracts path from the given URL.
|
static java.lang.String |
extractProtocol(java.lang.String url)
Extracts protocol from the given URL.
|
VirtualFile |
findFileById(int id) |
abstract VirtualFile |
findFileByUrl(java.lang.String url)
Searches for a file specified by the given
URL . |
abstract VirtualFileSystem |
getFileSystem(java.lang.String protocol)
Gets VirtualFileSystem with the specified protocol.
|
static VirtualFileManager |
getInstance()
Gets the instance of
VirtualFileManager . |
abstract long |
getModificationCount() |
abstract long |
getStructureModificationCount() |
abstract java.lang.CharSequence |
getVFileName(int nameId) |
abstract void |
notifyPropertyChanged(VirtualFile virtualFile,
java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue) |
abstract VirtualFile |
refreshAndFindFileByUrl(java.lang.String url)
Refreshes only the part of the file system needed for searching the file by the given URL and finds file
by the given URL.
|
abstract void |
refreshWithoutFileWatcher(boolean asynchronous) |
abstract void |
removeVirtualFileListener(VirtualFileListener listener)
Deprecated.
Use
VFS_CHANGES message bus topic. |
abstract void |
removeVirtualFileManagerListener(VirtualFileManagerListener listener) |
abstract int |
storeName(java.lang.String name) |
abstract long |
syncRefresh()
Refreshes the cached file systems information from the physical file systems synchronously.
|
public static final Topic<BulkFileListener> VFS_CHANGES
public static final ModificationTracker VFS_STRUCTURE_MODIFICATIONS
public static VirtualFileManager getInstance()
VirtualFileManager
.VirtualFileManager
public abstract VirtualFileSystem getFileSystem(java.lang.String protocol)
protocol
- String representing the protocolVirtualFileSystem
VirtualFileSystem.getProtocol()
public abstract long syncRefresh()
Refreshes the cached file systems information from the physical file systems synchronously.
Note: this method should be only called within a write-action (see Application.runWriteAction(java.lang.Runnable))
public abstract long asyncRefresh(java.lang.Runnable postAction)
public abstract void refreshWithoutFileWatcher(boolean asynchronous)
public abstract VirtualFile findFileByUrl(java.lang.String url)
URL
.url
- the URL to find file byVirtualFile
if the file was found, null
otherwiseVirtualFile.getUrl()
,
VirtualFileSystem.findFileByPath(java.lang.String)
,
refreshAndFindFileByUrl(java.lang.String)
public abstract VirtualFile refreshAndFindFileByUrl(java.lang.String url)
Refreshes only the part of the file system needed for searching the file by the given URL and finds file by the given URL.
This method is useful when the file was created externally and you need to find
corresponding to it.VirtualFile
If this method is invoked not from Swing event dispatch thread, then it must not happen inside a read action.
url
- the URLVirtualFile
if the file was found, null
otherwiseVirtualFileSystem.findFileByPath(java.lang.String)
,
VirtualFileSystem.refreshAndFindFileByPath(java.lang.String)
@Deprecated public abstract void addVirtualFileListener(VirtualFileListener listener)
VFS_CHANGES
message bus topic.@Deprecated public abstract void addVirtualFileListener(VirtualFileListener listener, Disposable parentDisposable)
VFS_CHANGES
message bus topic.@Deprecated public abstract void removeVirtualFileListener(VirtualFileListener listener)
VFS_CHANGES
message bus topic.public abstract void addAsyncFileListener(AsyncFileListener listener, Disposable parentDisposable)
vfs.asyncListener
.public static java.lang.String constructUrl(java.lang.String protocol, java.lang.String path)
URL
by specified protocol and path.protocol
- the protocolpath
- the pathVirtualFile.getUrl()
public static java.lang.String extractProtocol(java.lang.String url)
url
- the URLnull
if there is no "://" in the URLVirtualFileSystem.getProtocol()
public static java.lang.String extractPath(java.lang.String url)
url
- the URLpublic abstract void addVirtualFileManagerListener(VirtualFileManagerListener listener)
public abstract void addVirtualFileManagerListener(VirtualFileManagerListener listener, Disposable parentDisposable)
public abstract void removeVirtualFileManagerListener(VirtualFileManagerListener listener)
public abstract void notifyPropertyChanged(VirtualFile virtualFile, java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
public abstract long getModificationCount()
getModificationCount
in interface ModificationTracker
getStructureModificationCount()
public abstract long getStructureModificationCount()
getModificationCount()
public VirtualFile findFileById(int id)
public abstract int storeName(java.lang.String name)
public abstract java.lang.CharSequence getVFileName(int nameId)