java.lang.Object
org.gjt.sp.jedit.io.VFSManager
jEdit's virtual filesystem allows it to transparently edit files
stored elsewhere than the local filesystem, for example on an FTP
site. See the
VFS
class for implementation details.
Note that most of the jEdit API is not thread-safe, so special care
must be taken when making jEdit API calls. Also, it is not safe to
call SwingUtilities.invokeAndWait()
from a work request;
it can cause a deadlock if the given runnable then later calls
waitForRequests()
.
- Version:
- $Id: VFSManager.java 25330 2020-05-09 14:21:52Z kpouer $
- Author:
- Slava Pestov
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canReadFile
(String path) Returns true if the file existsstatic void
Reports an I/O error with default urgency,Log.ERROR
static void
Reports an I/O error.static void
error
(IOException e, String path, Component comp) Handle an I/O error.static boolean
Returns if the last request caused an error.static VFS
Returns the local filesystem VFS.static int
Returns the number of pending I/O requests.static VFS
Returns the URL VFS.static VFS
getVFSForPath
(String path) Returns the VFS for the specified path.static VFS
getVFSForProtocol
(String protocol) Returns the VFS for the specified protocol.static String[]
getVFSs()
Returns a list of all registered filesystems.static void
init()
Do not call.static void
runInAWTThread
(Runnable run) Deprecated.Using that method, when you run a task in AWT Thread, it will wait for all background task causing some unwanted delays.static void
runInWorkThread
(Task run) Deprecated.You should not use this method, this threadpool links the AWT Threads and Work threads.static void
sendVFSUpdate
(VFS vfs, String path, boolean parent) Sends a VFS update message.static void
start()
Do not call.static void
Returns when all pending requests are complete.
-
Field Details
-
SERVICE
The service type. SeeServiceManager
.- Since:
- jEdit 4.2pre1
- See Also:
-
-
Method Details
-
init
public static void init()Do not call. -
start
public static void start()Do not call. -
canReadFile
Returns true if the file exists- Parameters:
path
- the path of the file- Returns:
- true if the file exists and can be read
- Since:
- jEdit 5.6pre1
-
getFileVFS
Returns the local filesystem VFS.- Since:
- jEdit 2.5pre1
-
getUrlVFS
Returns the URL VFS.- Since:
- jEdit 2.5pre1
-
getVFSForProtocol
Returns the VFS for the specified protocol.- Parameters:
protocol
- The protocol- Since:
- jEdit 2.5pre1
-
getVFSForPath
Returns the VFS for the specified path.- Parameters:
path
- The path- Since:
- jEdit 2.6pre4
-
getVFSs
Returns a list of all registered filesystems.- Since:
- jEdit 4.2pre1
-
waitForRequests
public static void waitForRequests()Returns when all pending requests are complete. Must be called in the Event Dispatch Thread- Since:
- jEdit 2.5pre1
-
errorOccurred
public static boolean errorOccurred()Returns if the last request caused an error. -
getRequestCount
public static int getRequestCount()Returns the number of pending I/O requests. -
runInAWTThread
Deprecated.Using that method, when you run a task in AWT Thread, it will wait for all background task causing some unwanted delays. If you need calling a task after a background work, please add your runnable to the EDT thread yourself at the end of the background taskExecutes the specified runnable in the AWT thread once all pending I/O requests are complete. Only in one case theRunnable
is executed directly: when the current thread is EDT and there are no I/O requests active or queued at the moment of call.- Since:
- jEdit 2.5pre1
- See Also:
-
runInWorkThread
Deprecated.You should not use this method, this threadpool links the AWT Threads and Work threads.Executes the specified runnable in one of the I/O threads.- Since:
- jEdit 2.6pre2
- See Also:
-
error
Handle an I/O error.- Since:
- jEdit 4.3pre3
-
error
Reports an I/O error with default urgency,Log.ERROR
- Parameters:
comp
- The componentpath
- The path name that caused the errormessageProp
- The error message property nameargs
- Positional parameters- Since:
- jEdit 4.0pre3
-
error
public static void error(Component comp, String path, String messageProp, Object[] args, int urgency) Reports an I/O error.- Parameters:
comp
- The componentpath
- The path name that caused the errormessageProp
- The error message property nameargs
- Positional parametersurgency
- Logging urgency (level)- Since:
- jEdit 5.0pre1
-
sendVFSUpdate
Sends a VFS update message.- Parameters:
vfs
- The VFSpath
- The path that changedparent
- True if an update should be sent for the path's parent too- Since:
- jEdit 2.6pre4
-