java.lang.Object
org.gjt.sp.jedit.io.VFS
org.gjt.sp.jedit.io.FileVFS
Local filesystem VFS.
- Version:
- $Id: FileVFS.java 25330 2020-05-09 14:21:52Z kpouer $
- Author:
- Slava Pestov
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gjt.sp.jedit.io.VFS
VFS.DirectoryEntryCompare
-
Field Summary
Fields inherited from class org.gjt.sp.jedit.io.VFS
BROWSE_CAP, CASE_INSENSITIVE_CAP, DELETE_CAP, EA_MODIFIED, EA_SIZE, EA_STATUS, EA_TYPE, IOBUFSIZE, LOW_LATENCY_CAP, MKDIR_CAP, NON_AWT_SESSION_CAP, READ_CAP, RENAME_CAP, WRITE_CAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_canonPath
(Object session, String path, Component comp) Returns the canonical form if the specified path name._createInputStream
(Object session, String path, boolean ignoreErrors, Component comp) Creates an input stream._createOutputStream
(Object session, String path, Component comp) Creates an output stream.boolean
Deletes the specified URL.Returns the specified directory entry.VFSFile[]
_listFiles
(Object session, String path, Component comp) Lists the specified directory.boolean
Creates a new directory with the specified URL.boolean
Renames the specified URL.void
_saveComplete
(Object session, Buffer buffer, String path, Component comp) Called after a file has been saved.constructPath
(String parent, String path) Constructs a path from the specified directory and file name component.char
Returns the file separator used by this VFS.getParentOfPath
(String path) Returns the parent of the specified path.static int
getPermissions
(String path) Returns numeric permissions of a file.getTwoStageSaveName
(String path) Returns a temporary file name based on the given path.boolean
Inserts a file into the specified buffer.static boolean
recursiveDelete
(File path) #boolean
Saves the specifies buffer.static void
setPermissions
(String path, int permissions) Sets numeric permissions of a file.Methods inherited from class org.gjt.sp.jedit.io.VFS
_backup, _endVFSSession, _finishTwoStageSave, _listDirectory, _listDirectory, _listDirectory, copy, copy, copy, copy, createVFSSession, createVFSSessionSafe, getCapabilities, getDefaultColorFor, getDefaultEncoding, getExtendedAttributes, getFileName, getFilePath, getName, isMarkersFileSupported, load, reloadDirectory, setEncoding
-
Field Details
-
PERMISSIONS_PROPERTY
- See Also:
-
-
Constructor Details
-
FileVFS
public FileVFS()
-
-
Method Details
-
getParentOfPath
Description copied from class:VFS
Returns the parent of the specified path. This must be overridden to return a non-null value for browsing of this filesystem to work.- Overrides:
getParentOfPath
in classVFS
- Parameters:
path
- The path
-
constructPath
Description copied from class:VFS
Constructs a path from the specified directory and file name component. This must be overridden to return a non-null value, otherwise browsing this filesystem will not work.Unless you are writing a VFS, this method should not be called directly. To ensure correct behavior, you must call
MiscUtilities.constructPath(String,String)
instead.- Overrides:
constructPath
in classVFS
- Parameters:
parent
- The parent directorypath
- The path
-
getFileSeparator
public char getFileSeparator()Description copied from class:VFS
Returns the file separator used by this VFS.- Overrides:
getFileSeparator
in classVFS
-
getTwoStageSaveName
Returns a temporary file name based on the given path.If the directory where the file would be created cannot be written (i.e., no new files can be created in that directory), this method returns
null
.- Overrides:
getTwoStageSaveName
in classVFS
- Parameters:
path
- The path name
-
save
Description copied from class:VFS
Saves the specifies buffer. The default implementation posts an I/O request to the I/O thread. -
insert
Description copied from class:VFS
Inserts a file into the specified buffer. The default implementation posts an I/O request to the I/O thread. -
recursiveDelete
#- Parameters:
path
- the directory path to recursive delete- Returns:
- true if successful, else false
-
_canonPath
Returns the canonical form if the specified path name. For example,~
might be expanded to the user's home directory.- Overrides:
_canonPath
in classVFS
- Parameters:
session
- The sessionpath
- The pathcomp
- The component that will parent error dialog boxes- Throws:
IOException
- if an I/O error occurred- Since:
- jEdit 4.0pre2
-
_listFiles
Description copied from class:VFS
Lists the specified directory.- Overrides:
_listFiles
in classVFS
- Parameters:
session
- The sessionpath
- The directory. Note that this must be a full URL, including the host name, path name, and so on. The username and password (if needed by the VFS) is obtained from the session instance.comp
- The component that will parent error dialog boxes
-
_getFile
Description copied from class:VFS
Returns the specified directory entry.- Overrides:
_getFile
in classVFS
- Parameters:
session
- The session get it withVFS.createVFSSession(String, Component)
path
- The pathcomp
- The component that will parent error dialog boxes- Returns:
- The specified directory entry, or null if it doesn't exist.
-
_delete
Description copied from class:VFS
Deletes the specified URL. -
_rename
Description copied from class:VFS
Renames the specified URL. Some filesystems might support moving URLs between directories, however others may not. Do not rely on this behavior. -
_mkdir
Description copied from class:VFS
Creates a new directory with the specified URL. -
_createInputStream
public InputStream _createInputStream(Object session, String path, boolean ignoreErrors, Component comp) throws IOException Description copied from class:VFS
Creates an input stream. This method is called from the I/O thread.- Overrides:
_createInputStream
in classVFS
- Parameters:
session
- the VFS sessionpath
- The pathignoreErrors
- If true, file not found errors should be ignoredcomp
- The component that will parent error dialog boxes- Returns:
- an inputstream or
null
if there was a problem - Throws:
IOException
- If an I/O error occurs
-
_createOutputStream
public OutputStream _createOutputStream(Object session, String path, Component comp) throws IOException Description copied from class:VFS
Creates an output stream. This method is called from the I/O thread.- Overrides:
_createOutputStream
in classVFS
- Parameters:
session
- the VFS sessionpath
- The pathcomp
- The component that will parent error dialog boxes- Throws:
IOException
- If an I/O error occurs
-
_saveComplete
Description copied from class:VFS
Called after a file has been saved.- Overrides:
_saveComplete
in classVFS
- Parameters:
session
- The VFS sessionbuffer
- The bufferpath
- The path the buffer was saved to (can be different fromBuffer.getPath()
if the user invoked the Save a Copy As command, for example).comp
- The component that will parent error dialog boxes
-
getPermissions
Returns numeric permissions of a file. On non-Unix systems, always returns zero.- Since:
- jEdit 3.2pre9
-
setPermissions
Sets numeric permissions of a file. On non-Unix platforms, does nothing.- Since:
- jEdit 3.2pre9
-