public class VFSFile
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
color |
protected boolean |
colorCalculated |
static int |
DIRECTORY |
static int |
FILE |
static int |
FILESYSTEM |
Constructor and Description |
---|
VFSFile() |
VFSFile(java.lang.String name,
java.lang.String path,
java.lang.String deletePath,
int type,
long length,
boolean hidden) |
Modifier and Type | Method and Description |
---|---|
protected void |
fetchAttrs()
Fetch some attributes of the file.
|
protected boolean |
fetchedAttrs()
Returns true if the attributes are already fetched.
|
static java.lang.String |
findCompletion(java.lang.String path,
java.lang.String complete,
VFSBrowser browser,
boolean dirsOnly) |
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.
|
java.awt.Color |
getColor()
Returns the color that will be used to display the file.
|
javax.swing.Icon |
getDefaultIcon(boolean expanded)
Returns the default icon of the file.
|
javax.swing.Icon |
getDefaultIcon(boolean expanded,
boolean openBuffer)
Returns the default icon for the file.
|
java.lang.String |
getDeletePath() |
java.lang.String |
getExtendedAttribute(java.lang.String name)
Returns the value of an extended attribute.
|
javax.swing.Icon |
getIcon(boolean expanded)
Returns the icon for the file.
|
javax.swing.Icon |
getIcon(boolean expanded,
boolean openBuffer)
Returns the icon for the file.
|
long |
getLength() |
long |
getModified()
return file modified date, this function simply return 0,
VFS implementation should overwrite this to return the
real modified data
|
java.lang.String |
getName() |
java.lang.String |
getPath() |
java.lang.String |
getSymlinkPath() |
int |
getType() |
VFS |
getVFS() |
boolean |
isBinary(java.lang.Object session)
Check if a file is binary file.
|
boolean |
isHidden() |
boolean |
isReadable() |
boolean |
isWriteable() |
void |
setDeletePath(java.lang.String deletePath) |
void |
setHidden(boolean hidden) |
void |
setLength(long length) |
void |
setName(java.lang.String name) |
void |
setPath(java.lang.String path) |
void |
setReadable(boolean canRead) |
void |
setSymlinkPath(java.lang.String symlinkPath) |
void |
setType(int type) |
void |
setWriteable(boolean canWrite) |
java.lang.String |
toString() |
public static final int FILE
public static final int DIRECTORY
public static final int FILESYSTEM
protected boolean colorCalculated
protected java.awt.Color color
public VFSFile()
public VFSFile(java.lang.String name, java.lang.String path, java.lang.String deletePath, int type, long length, boolean hidden)
public static int findCompletion(VFSFile[] files, int start, int end, java.lang.String str, boolean dirsOnly)
files
- The list of filesstart
- The start index, inclusiveend
- The end index, exclusivestr
- The string to matchdirsOnly
- Only match directories?public static java.lang.String findCompletion(java.lang.String path, java.lang.String complete, VFSBrowser browser, boolean dirsOnly)
public final javax.swing.Icon getIcon(boolean expanded)
public javax.swing.Icon getIcon(boolean expanded, boolean openBuffer)
public final javax.swing.Icon getDefaultIcon(boolean expanded, boolean openBuffer)
public final javax.swing.Icon getDefaultIcon(boolean expanded)
public VFS getVFS()
public java.lang.String getName()
public void setName(java.lang.String name)
public boolean isBinary(java.lang.Object session) throws java.io.IOException
session
- the VFS sessiontrue
if the file was detected as binaryjava.io.IOException
- IOException If an I/O error occurspublic java.lang.String getPath()
public void setPath(java.lang.String path)
public java.lang.String getSymlinkPath()
public void setSymlinkPath(java.lang.String symlinkPath)
public java.lang.String getDeletePath()
public void setDeletePath(java.lang.String deletePath)
public int getType()
public void setType(int type)
public long getLength()
public void setLength(long length)
public boolean isHidden()
public void setHidden(boolean hidden)
public boolean isReadable()
public void setReadable(boolean canRead)
public boolean isWriteable()
public void setWriteable(boolean canWrite)
public java.lang.String getExtendedAttribute(java.lang.String name)
name
- The extended attribute namepublic java.awt.Color getColor()
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean fetchedAttrs()
true
if the attributes are already fetchedfetchAttrs()
protected void fetchAttrs()
public long getModified()