public class VirtualFileManagerImpl extends VirtualFileManagerEx implements Disposable
Disposable.Parent| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOG |
VFS_CHANGES, VFS_STRUCTURE_MODIFICATIONSEVER_CHANGED, NEVER_CHANGED| Constructor and Description |
|---|
VirtualFileManagerImpl(java.util.List<? extends VirtualFileSystem> preCreatedFileSystems) |
VirtualFileManagerImpl(java.util.List<? extends VirtualFileSystem> preCreatedFileSystems,
MessageBus bus) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAsyncFileListener(AsyncFileListener listener,
Disposable parentDisposable)
Consider using extension point
vfs.asyncListener. |
void |
addVirtualFileListener(VirtualFileListener listener) |
void |
addVirtualFileListener(VirtualFileListener listener,
Disposable parentDisposable) |
void |
addVirtualFileManagerListener(VirtualFileManagerListener listener) |
void |
addVirtualFileManagerListener(VirtualFileManagerListener listener,
Disposable parentDisposable) |
long |
asyncRefresh(java.lang.Runnable postAction)
Refreshes the cached file systems information from the physical file systems asynchronously.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
protected long |
doRefresh(boolean asynchronous,
java.lang.Runnable postAction) |
VirtualFile |
findFileByUrl(java.lang.String url)
Searches for a file specified by the given
URL. |
void |
fireAfterRefreshFinish(boolean asynchronous) |
void |
fireBeforeRefreshStart(boolean asynchronous) |
java.util.List<AsyncFileListener> |
getAsyncFileListeners() |
VirtualFileSystem |
getFileSystem(java.lang.String protocol)
Gets VirtualFileSystem with the specified protocol.
|
long |
getModificationCount() |
java.util.List<VirtualFileSystem> |
getPhysicalFileSystems() |
long |
getStructureModificationCount() |
java.lang.CharSequence |
getVFileName(int nameId) |
void |
notifyPropertyChanged(VirtualFile virtualFile,
java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue) |
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.
|
void |
refreshWithoutFileWatcher(boolean asynchronous) |
void |
removeVirtualFileListener(VirtualFileListener listener) |
void |
removeVirtualFileManagerListener(VirtualFileManagerListener listener) |
int |
storeName(java.lang.String name) |
long |
syncRefresh()
Refreshes the cached file systems information from the physical file systems synchronously.
|
constructUrl, extractPath, extractProtocol, findFileById, getInstanceprotected static final Logger LOG
public VirtualFileManagerImpl(java.util.List<? extends VirtualFileSystem> preCreatedFileSystems)
public VirtualFileManagerImpl(java.util.List<? extends VirtualFileSystem> preCreatedFileSystems, MessageBus bus)
public java.util.List<VirtualFileSystem> getPhysicalFileSystems()
public void dispose()
Disposabledispose in interface Disposablepublic long getStructureModificationCount()
getStructureModificationCount in class VirtualFileManagerVirtualFileManager.getModificationCount()public VirtualFileSystem getFileSystem(java.lang.String protocol)
VirtualFileManagergetFileSystem in class VirtualFileManagerprotocol - String representing the protocolVirtualFileSystemVirtualFileSystem.getProtocol()public long syncRefresh()
VirtualFileManagerRefreshes 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))
syncRefresh in class VirtualFileManagerpublic long asyncRefresh(java.lang.Runnable postAction)
VirtualFileManagerasyncRefresh in class VirtualFileManagerprotected long doRefresh(boolean asynchronous,
java.lang.Runnable postAction)
public void refreshWithoutFileWatcher(boolean asynchronous)
refreshWithoutFileWatcher in class VirtualFileManagerpublic VirtualFile findFileByUrl(java.lang.String url)
VirtualFileManagerURL.findFileByUrl in class VirtualFileManagerurl - the URL to find file byVirtualFile if the file was found, null otherwiseVirtualFile.getUrl(),
VirtualFileSystem.findFileByPath(java.lang.String),
VirtualFileManager.refreshAndFindFileByUrl(java.lang.String)public VirtualFile refreshAndFindFileByUrl(java.lang.String url)
VirtualFileManagerRefreshes 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.
refreshAndFindFileByUrl in class VirtualFileManagerurl - the URLVirtualFile if the file was found, null otherwiseVirtualFileSystem.findFileByPath(java.lang.String),
VirtualFileSystem.refreshAndFindFileByPath(java.lang.String)public void addVirtualFileListener(VirtualFileListener listener)
addVirtualFileListener in class VirtualFileManagerpublic void addVirtualFileListener(VirtualFileListener listener, Disposable parentDisposable)
addVirtualFileListener in class VirtualFileManagerpublic void removeVirtualFileListener(VirtualFileListener listener)
removeVirtualFileListener in class VirtualFileManagerpublic void addVirtualFileManagerListener(VirtualFileManagerListener listener)
addVirtualFileManagerListener in class VirtualFileManagerpublic void addVirtualFileManagerListener(VirtualFileManagerListener listener, Disposable parentDisposable)
addVirtualFileManagerListener in class VirtualFileManagerpublic void removeVirtualFileManagerListener(VirtualFileManagerListener listener)
removeVirtualFileManagerListener in class VirtualFileManagerpublic void addAsyncFileListener(AsyncFileListener listener, Disposable parentDisposable)
VirtualFileManagervfs.asyncListener.addAsyncFileListener in class VirtualFileManagerpublic java.util.List<AsyncFileListener> getAsyncFileListeners()
public void notifyPropertyChanged(VirtualFile virtualFile, java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
notifyPropertyChanged in class VirtualFileManagerpublic void fireBeforeRefreshStart(boolean asynchronous)
fireBeforeRefreshStart in class VirtualFileManagerExpublic void fireAfterRefreshFinish(boolean asynchronous)
fireAfterRefreshFinish in class VirtualFileManagerExpublic long getModificationCount()
getModificationCount in interface ModificationTrackergetModificationCount in class VirtualFileManagerVirtualFileManager.getStructureModificationCount()public int storeName(java.lang.String name)
storeName in class VirtualFileManagerpublic java.lang.CharSequence getVFileName(int nameId)
getVFileName in class VirtualFileManager