java.lang.Object
org.gjt.sp.jedit.io.VFSFile
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FavoritesVFS.Favorite
,FileVFS.LocalFile
,VFSAdapter.Entry
A directory entry returned from a file listing.
- Since:
- jEdit 4.3pre2
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Color
protected boolean
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Fetch some attributes of the file.protected boolean
Returns true if the attributes are already fetched.static String
findCompletion
(String path, String complete, VFSBrowser browser, boolean dirsOnly) 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.getColor()
Returns the color that will be used to display the file.final Icon
getDefaultIcon
(boolean expanded) Returns the default icon of the file.final Icon
getDefaultIcon
(boolean expanded, boolean openBuffer) Returns the default icon for the file.getExtendedAttribute
(String name) Returns the value of an extended attribute.final Icon
getIcon
(boolean expanded) Returns the icon for the file.getIcon
(boolean expanded, boolean openBuffer) Returns the icon for the file.long
long
return file modified date, this function simply return 0, VFS implementation should overwrite this to return the real modified datagetName()
getPath()
int
getType()
getVFS()
boolean
Check if a file is binary file.boolean
isHidden()
boolean
boolean
void
setDeletePath
(String deletePath) void
setHidden
(boolean hidden) void
setLength
(long length) void
void
void
setReadable
(boolean canRead) void
setSymlinkPath
(String symlinkPath) void
setType
(int type) void
setWriteable
(boolean canWrite) toString()
-
Field Details
-
FILE
public static final int FILE- See Also:
-
DIRECTORY
public static final int DIRECTORY- See Also:
-
FILESYSTEM
public static final int FILESYSTEM- See Also:
-
colorCalculated
protected boolean colorCalculated -
color
-
-
Constructor Details
-
VFSFile
public VFSFile()- Since:
- jEdit 4.3pre2
-
VFSFile
-
-
Method Details
-
findCompletion
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 String findCompletion(String path, String complete, VFSBrowser browser, boolean dirsOnly) -
getIcon
Returns the icon for the file.- Since:
- jEdit 4.3pre9
-
getIcon
Returns the icon for the file. Implementations of File system browsers can override this method- Since:
- jEdit 4.3pre9
-
getDefaultIcon
Returns the default icon for the file.- Since:
- jEdit 4.3pre9
-
getDefaultIcon
Returns the default icon of the file.- Returns:
- the default icon of the file
- Since:
- jEdit 4.3pre9
-
getVFS
- Returns:
- The originating virtual file system of this file.
-
getName
-
setName
-
isBinary
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
-
setPath
-
getSymlinkPath
-
setSymlinkPath
-
getDeletePath
-
setDeletePath
-
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
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
Returns the color that will be used to display the file.- Returns:
- the color of the file
-
toString
-
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
-