public abstract class HttpFileSystemBase extends HttpFileSystem
Constructor and Description |
---|
HttpFileSystemBase(java.lang.String protocol) |
Modifier and Type | Method and Description |
---|---|
void |
addFileListener(HttpVirtualFileListener listener) |
void |
addFileListener(HttpVirtualFileListener listener,
Disposable parentDisposable) |
VirtualFile |
createChild(VirtualFile parent,
java.lang.String name,
boolean isDirectory) |
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
|
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.
|
VirtualFile |
findFileByPath(java.lang.String path,
boolean isDirectory) |
java.lang.String |
getProtocol()
Gets the protocol for this file system.
|
boolean |
isFileDownloaded(VirtualFile file) |
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 |
removeFileListener(HttpVirtualFileListener listener) |
getInstance
addVirtualFileListener, assertWriteAccessAllowed, copyFile, deleteFile, fireBeforeContentsChange, fireBeforeFileDeletion, fireBeforeFileMovement, fireBeforePropertyChange, fireContentsChanged, fireFileCopied, fireFileCreated, fireFileDeleted, fireFileMoved, firePropertyChanged, isReadOnly, moveFile, removeVirtualFileListener, renameFile, startEventPropagation
isCaseSensitive, isValidName
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 VirtualFile findFileByPath(java.lang.String path, boolean isDirectory)
public void addFileListener(HttpVirtualFileListener listener)
addFileListener
in class HttpFileSystem
public void addFileListener(HttpVirtualFileListener listener, Disposable parentDisposable)
addFileListener
in class HttpFileSystem
public void removeFileListener(HttpVirtualFileListener listener)
removeFileListener
in class HttpFileSystem
public boolean isFileDownloaded(VirtualFile file)
isFileDownloaded
in class HttpFileSystem
public VirtualFile createChild(VirtualFile parent, java.lang.String name, boolean isDirectory)
createChild
in class HttpFileSystem
public VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile vDir, java.lang.String dirName) throws java.io.IOException
VirtualFileSystem
createChildDirectory
in class DeprecatedVirtualFileSystem
java.io.IOException
VirtualFile.createChildDirectory(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 java.lang.String extractPresentableUrl(java.lang.String path)
VirtualFileSystem
extractPresentableUrl
in class VirtualFileSystem
path
- the path to get presentable URL forVirtualFile.getPresentableUrl()
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 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 java.lang.String getProtocol()
VirtualFileSystem
KeyedLazyInstanceEP.key
.getProtocol
in class VirtualFileSystem
VirtualFile.getUrl()
,
VirtualFileManager.getFileSystem(java.lang.String)