public class VirtualFileManagerImpl extends VirtualFileManagerEx implements Disposable
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG |
VFS_CHANGES, VFS_STRUCTURE_MODIFICATIONS
EVER_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, getInstance
protected 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()
Disposable
dispose
in interface Disposable
public long getStructureModificationCount()
getStructureModificationCount
in class VirtualFileManager
VirtualFileManager.getModificationCount()
public VirtualFileSystem getFileSystem(java.lang.String protocol)
VirtualFileManager
getFileSystem
in class VirtualFileManager
protocol
- String representing the protocolVirtualFileSystem
VirtualFileSystem.getProtocol()
public long syncRefresh()
VirtualFileManager
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))
syncRefresh
in class VirtualFileManager
public long asyncRefresh(java.lang.Runnable postAction)
VirtualFileManager
asyncRefresh
in class VirtualFileManager
protected long doRefresh(boolean asynchronous, java.lang.Runnable postAction)
public void refreshWithoutFileWatcher(boolean asynchronous)
refreshWithoutFileWatcher
in class VirtualFileManager
public VirtualFile findFileByUrl(java.lang.String url)
VirtualFileManager
URL
.findFileByUrl
in class VirtualFileManager
url
- 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)
VirtualFileManager
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.
refreshAndFindFileByUrl
in class VirtualFileManager
url
- 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 VirtualFileManager
public void addVirtualFileListener(VirtualFileListener listener, Disposable parentDisposable)
addVirtualFileListener
in class VirtualFileManager
public void removeVirtualFileListener(VirtualFileListener listener)
removeVirtualFileListener
in class VirtualFileManager
public void addVirtualFileManagerListener(VirtualFileManagerListener listener)
addVirtualFileManagerListener
in class VirtualFileManager
public void addVirtualFileManagerListener(VirtualFileManagerListener listener, Disposable parentDisposable)
addVirtualFileManagerListener
in class VirtualFileManager
public void removeVirtualFileManagerListener(VirtualFileManagerListener listener)
removeVirtualFileManagerListener
in class VirtualFileManager
public void addAsyncFileListener(AsyncFileListener listener, Disposable parentDisposable)
VirtualFileManager
vfs.asyncListener
.addAsyncFileListener
in class VirtualFileManager
public 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 VirtualFileManager
public void fireBeforeRefreshStart(boolean asynchronous)
fireBeforeRefreshStart
in class VirtualFileManagerEx
public void fireAfterRefreshFinish(boolean asynchronous)
fireAfterRefreshFinish
in class VirtualFileManagerEx
public long getModificationCount()
getModificationCount
in interface ModificationTracker
getModificationCount
in class VirtualFileManager
VirtualFileManager.getStructureModificationCount()
public int storeName(java.lang.String name)
storeName
in class VirtualFileManager
public java.lang.CharSequence getVFileName(int nameId)
getVFileName
in class VirtualFileManager