Package org.gjt.sp.jedit.io
Class VFSFile
- java.lang.Object
-
- org.gjt.sp.jedit.io.VFSFile
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
FavoritesVFS.Favorite,FileVFS.LocalFile
public class VFSFile extends java.lang.Object implements java.io.SerializableA directory entry returned from a file listing.- Since:
- jEdit 4.3pre2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Colorcolorprotected booleancolorCalculatedstatic intDIRECTORYstatic intFILEstatic intFILESYSTEM
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfetchAttrs()Fetch some attributes of the file.protected booleanfetchedAttrs()Returns true if the attributes are already fetched.static java.lang.StringfindCompletion(java.lang.String path, java.lang.String complete, VFSBrowser browser, boolean dirsOnly)static intfindCompletion(VFSFile[] files, int start, int end, java.lang.String str, boolean dirsOnly)Return the index of a file whose name matches the given string, in a case-insensitive manner.java.awt.ColorgetColor()Returns the color that will be used to display the file.javax.swing.IcongetDefaultIcon(boolean expanded)Returns the default icon of the file.javax.swing.IcongetDefaultIcon(boolean expanded, boolean openBuffer)Returns the default icon for the file.java.lang.StringgetDeletePath()java.lang.StringgetExtendedAttribute(java.lang.String name)Returns the value of an extended attribute.javax.swing.IcongetIcon(boolean expanded)Returns the icon for the file.javax.swing.IcongetIcon(boolean expanded, boolean openBuffer)Returns the icon for the file.longgetLength()longgetModified()return file modified date, this function simply return 0, VFS implementation should overwrite this to return the real modified datajava.lang.StringgetName()java.lang.StringgetPath()java.lang.StringgetSymlinkPath()intgetType()VFSgetVFS()booleanisBinary(java.lang.Object session)Check if a file is binary file.booleanisHidden()booleanisReadable()booleanisWriteable()voidsetDeletePath(java.lang.String deletePath)voidsetHidden(boolean hidden)voidsetLength(long length)voidsetName(java.lang.String name)voidsetPath(java.lang.String path)voidsetReadable(boolean canRead)voidsetSymlinkPath(java.lang.String symlinkPath)voidsetType(int type)voidsetWriteable(boolean canWrite)java.lang.StringtoString()
-
-
-
Field Detail
-
FILE
public static final int FILE
- See Also:
- Constant Field Values
-
DIRECTORY
public static final int DIRECTORY
- See Also:
- Constant Field Values
-
FILESYSTEM
public static final int FILESYSTEM
- See Also:
- Constant Field Values
-
colorCalculated
protected boolean colorCalculated
-
color
protected java.awt.Color color
-
-
Method Detail
-
findCompletion
public static int findCompletion(VFSFile[] files, int start, int end, java.lang.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 filesstart- The start index, inclusiveend- The end index, exclusivestr- The string to matchdirsOnly- Only match directories?- Since:
- jEdit 4.3pre3
-
findCompletion
public static java.lang.String findCompletion(java.lang.String path, java.lang.String complete, VFSBrowser browser, boolean dirsOnly)
-
getIcon
public final javax.swing.Icon getIcon(boolean expanded)
Returns the icon for the file.- Since:
- jEdit 4.3pre9
-
getIcon
public javax.swing.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 javax.swing.Icon getDefaultIcon(boolean expanded, boolean openBuffer)Returns the default icon for the file.- Since:
- jEdit 4.3pre9
-
getDefaultIcon
public final javax.swing.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 java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
isBinary
public boolean isBinary(java.lang.Object session) throws java.io.IOExceptionCheck if a file is binary file.- Parameters:
session- the VFS session- Returns:
trueif the file was detected as binary- Throws:
java.io.IOException- IOException If an I/O error occurs- Since:
- jEdit 4.3pre5
-
getPath
public java.lang.String getPath()
-
setPath
public void setPath(java.lang.String path)
-
getSymlinkPath
public java.lang.String getSymlinkPath()
-
setSymlinkPath
public void setSymlinkPath(java.lang.String symlinkPath)
-
getDeletePath
public java.lang.String getDeletePath()
-
setDeletePath
public void setDeletePath(java.lang.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 java.lang.String getExtendedAttribute(java.lang.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 java.awt.Color getColor()
Returns the color that will be used to display the file.- Returns:
- the color of the file
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fetchedAttrs
protected boolean fetchedAttrs()
Returns true if the attributes are already fetched.- Returns:
trueif the attributes are already fetched- See Also:
fetchAttrs()
-
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
-
-