Module jEdit

Class VFSFile

java.lang.Object
org.gjt.sp.jedit.io.VFSFile
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FavoritesVFS.Favorite, FileVFS.LocalFile, VFSAdapter.Entry

public class VFSFile extends Object implements Serializable
A directory entry returned from a file listing.
Since:
jEdit 4.3pre2
See Also:
  • Field Details

  • Constructor Details

    • VFSFile

      public VFSFile()
      Since:
      jEdit 4.3pre2
    • VFSFile

      public VFSFile(String name, String path, String deletePath, int type, long length, boolean hidden)
  • Method Details

    • findCompletion

      public static int findCompletion(VFSFile[] files, int start, int end, String str, boolean dirsOnly)
      Return the index of a file whose name matches the given string, in a case-insensitive manner. Exact matches are preferred, then same length with different cases, then first found.
      Parameters:
      files - The list of files
      start - The start index, inclusive
      end - The end index, exclusive
      str - The string to match
      dirsOnly - Only match directories?
      Since:
      jEdit 4.3pre3
    • findCompletion

      public static String findCompletion(String path, String complete, VFSBrowser browser, boolean dirsOnly)
    • getIcon

      public final Icon getIcon(boolean expanded)
      Returns the icon for the file.
      Since:
      jEdit 4.3pre9
    • getIcon

      public Icon getIcon(boolean expanded, boolean openBuffer)
      Returns the icon for the file. Implementations of File system browsers can override this method
      Since:
      jEdit 4.3pre9
    • getDefaultIcon

      public final Icon getDefaultIcon(boolean expanded, boolean openBuffer)
      Returns the default icon for the file.
      Since:
      jEdit 4.3pre9
    • getDefaultIcon

      public final Icon getDefaultIcon(boolean expanded)
      Returns the default icon of the file.
      Returns:
      the default icon of the file
      Since:
      jEdit 4.3pre9
    • getVFS

      public VFS getVFS()
      Returns:
      The originating virtual file system of this file.
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • isBinary

      public boolean isBinary(Object session) throws IOException
      Check if a file is binary file.
      Parameters:
      session - the VFS session
      Returns:
      true if the file was detected as binary
      Throws:
      IOException - IOException If an I/O error occurs
      Since:
      jEdit 4.3pre5
    • getPath

      public String getPath()
    • setPath

      public void setPath(String path)
    • getSymlinkPath

      public String getSymlinkPath()
    • setSymlinkPath

      public void setSymlinkPath(String symlinkPath)
    • getDeletePath

      public String getDeletePath()
    • setDeletePath

      public void setDeletePath(String deletePath)
    • getType

      public int getType()
    • setType

      public void setType(int type)
    • getLength

      public long getLength()
    • setLength

      public void setLength(long length)
    • isHidden

      public boolean isHidden()
    • setHidden

      public void setHidden(boolean hidden)
    • isReadable

      public boolean isReadable()
    • setReadable

      public void setReadable(boolean canRead)
    • isWriteable

      public boolean isWriteable()
    • setWriteable

      public void setWriteable(boolean canWrite)
    • getExtendedAttribute

      public String getExtendedAttribute(String name)
      Returns the value of an extended attribute. Note that this returns formatted strings (eg, "10 Mb" for a file size of 1048576 bytes). If you need access to the raw data, access fields and methods of this class.
      Parameters:
      name - The extended attribute name
      Since:
      jEdit 4.2pre1
    • getColor

      public Color getColor()
      Returns the color that will be used to display the file.
      Returns:
      the color of the file
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fetchedAttrs

      protected boolean fetchedAttrs()
      Returns true if the attributes are already fetched.
      Returns:
      true if the attributes are already fetched
      See Also:
    • fetchAttrs

      protected void fetchAttrs()
      Fetch some attributes of the file. Some attributes are not fetched during file initialization because it takes time. They are fetched here. VFS implementation should overwrite this
    • getModified

      public long getModified()
      return file modified date, this function simply return 0, VFS implementation should overwrite this to return the real modified data