Package org.gjt.sp.jedit.io
Class FileVFS
- java.lang.Object
-
- org.gjt.sp.jedit.io.VFS
-
- org.gjt.sp.jedit.io.FileVFS
-
public class FileVFS extends VFS
Local filesystem VFS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileVFS.LocalFile-
Nested classes/interfaces inherited from class org.gjt.sp.jedit.io.VFS
VFS.DirectoryEntryCompare
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPERMISSIONS_PROPERTY-
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
Constructors Constructor Description FileVFS()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String_canonPath(java.lang.Object session, java.lang.String path, java.awt.Component comp)Returns the canonical form if the specified path name.java.io.InputStream_createInputStream(java.lang.Object session, java.lang.String path, boolean ignoreErrors, java.awt.Component comp)Creates an input stream.java.io.OutputStream_createOutputStream(java.lang.Object session, java.lang.String path, java.awt.Component comp)Creates an output stream.boolean_delete(java.lang.Object session, java.lang.String path, java.awt.Component comp)Deletes the specified URL.VFSFile_getFile(java.lang.Object session, java.lang.String path, java.awt.Component comp)Returns the specified directory entry.VFSFile[]_listFiles(java.lang.Object session, java.lang.String path, java.awt.Component comp)Lists the specified directory.boolean_mkdir(java.lang.Object session, java.lang.String directory, java.awt.Component comp)Creates a new directory with the specified URL.boolean_rename(java.lang.Object session, java.lang.String from, java.lang.String to, java.awt.Component comp)Renames the specified URL.void_saveComplete(java.lang.Object session, Buffer buffer, java.lang.String path, java.awt.Component comp)Called after a file has been saved.java.lang.StringconstructPath(java.lang.String parent, java.lang.String path)Constructs a path from the specified directory and file name component.chargetFileSeparator()Returns the file separator used by this VFS.java.lang.StringgetParentOfPath(java.lang.String path)Returns the parent of the specified path.static intgetPermissions(java.lang.String path)Returns numeric permissions of a file.java.lang.StringgetTwoStageSaveName(java.lang.String path)Returns a temporary file name based on the given path.booleaninsert(View view, Buffer buffer, java.lang.String path)Inserts a file into the specified buffer.static booleanrecursiveDelete(java.io.File path)#booleansave(View view, Buffer buffer, java.lang.String path)Saves the specifies buffer.static voidsetPermissions(java.lang.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, getExtendedAttributes, getFileName, getFilePath, getName, isMarkersFileSupported, load, reloadDirectory
-
-
-
-
Field Detail
-
PERMISSIONS_PROPERTY
public static final java.lang.String PERMISSIONS_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getParentOfPath
@Nonnull public java.lang.String getParentOfPath(java.lang.String path)
Description copied from class:VFSReturns the parent of the specified path. This must be overridden to return a non-null value for browsing of this filesystem to work.- Overrides:
getParentOfPathin classVFS- Parameters:
path- The path
-
constructPath
public java.lang.String constructPath(java.lang.String parent, java.lang.String path)Description copied from class:VFSConstructs 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:
constructPathin classVFS- Parameters:
parent- The parent directorypath- The path
-
getFileSeparator
public char getFileSeparator()
Description copied from class:VFSReturns the file separator used by this VFS.- Overrides:
getFileSeparatorin classVFS
-
getTwoStageSaveName
@Nullable public java.lang.String getTwoStageSaveName(java.lang.String path)
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:
getTwoStageSaveNamein classVFS- Parameters:
path- The path name
-
save
public boolean save(View view, Buffer buffer, java.lang.String path)
Description copied from class:VFSSaves the specifies buffer. The default implementation posts an I/O request to the I/O thread.
-
insert
public boolean insert(View view, Buffer buffer, java.lang.String path)
Description copied from class:VFSInserts a file into the specified buffer. The default implementation posts an I/O request to the I/O thread.
-
recursiveDelete
public static boolean recursiveDelete(java.io.File path)
#- Parameters:
path- the directory path to recursive delete- Returns:
- true if successful, else false
-
_canonPath
public java.lang.String _canonPath(java.lang.Object session, java.lang.String path, java.awt.Component comp) throws java.io.IOExceptionReturns the canonical form if the specified path name. For example,~might be expanded to the user's home directory.- Overrides:
_canonPathin classVFS- Parameters:
session- The sessionpath- The pathcomp- The component that will parent error dialog boxes- Throws:
java.io.IOException- if an I/O error occurred- Since:
- jEdit 4.0pre2
-
_listFiles
public VFSFile[] _listFiles(java.lang.Object session, java.lang.String path, java.awt.Component comp)
Description copied from class:VFSLists the specified directory.- Overrides:
_listFilesin 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
public VFSFile _getFile(java.lang.Object session, java.lang.String path, java.awt.Component comp)
Description copied from class:VFSReturns the specified directory entry.- Overrides:
_getFilein 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
public boolean _delete(java.lang.Object session, java.lang.String path, java.awt.Component comp)Description copied from class:VFSDeletes the specified URL.
-
_rename
public boolean _rename(java.lang.Object session, java.lang.String from, java.lang.String to, java.awt.Component comp)Description copied from class:VFSRenames the specified URL. Some filesystems might support moving URLs between directories, however others may not. Do not rely on this behavior.
-
_mkdir
public boolean _mkdir(java.lang.Object session, java.lang.String directory, java.awt.Component comp)Description copied from class:VFSCreates a new directory with the specified URL.
-
_createInputStream
public java.io.InputStream _createInputStream(java.lang.Object session, java.lang.String path, boolean ignoreErrors, java.awt.Component comp) throws java.io.IOExceptionDescription copied from class:VFSCreates an input stream. This method is called from the I/O thread.- Overrides:
_createInputStreamin 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
nullif there was a problem - Throws:
java.io.IOException- If an I/O error occurs
-
_createOutputStream
public java.io.OutputStream _createOutputStream(java.lang.Object session, java.lang.String path, java.awt.Component comp) throws java.io.IOExceptionDescription copied from class:VFSCreates an output stream. This method is called from the I/O thread.- Overrides:
_createOutputStreamin classVFS- Parameters:
session- the VFS sessionpath- The pathcomp- The component that will parent error dialog boxes- Throws:
java.io.IOException- If an I/O error occurs
-
_saveComplete
public void _saveComplete(java.lang.Object session, Buffer buffer, java.lang.String path, java.awt.Component comp)Description copied from class:VFSCalled after a file has been saved.- Overrides:
_saveCompletein 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
public static int getPermissions(java.lang.String path)
Returns numeric permissions of a file. On non-Unix systems, always returns zero.- Since:
- jEdit 3.2pre9
-
setPermissions
public static void setPermissions(java.lang.String path, int permissions)Sets numeric permissions of a file. On non-Unix platforms, does nothing.- Since:
- jEdit 3.2pre9
-
-