|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.search.disk.FFile
File object.
FDirectory
Field Summary | |
protected java.io.File |
m_fname
File name. |
protected java.io.InputStream |
m_in
Input stream for this file. |
protected java.io.OutputStream |
m_out
Output stream for this file. |
protected FDirectory |
m_search
The directory searcher that found and created this file entry. |
protected static java.lang.String[] |
s_attrNames
Attribute names. |
static int |
SERIES
Series number. |
Constructor Summary | |
protected |
FFile(FDirectory dir,
java.io.File fname)
Constructor. |
Method Summary | |
void |
addAttribute(java.lang.String name)
Add a new attribute name to this document. |
boolean |
canRead()
Determine if this directory file is readable. |
boolean |
canWrite()
Determine if this directory file is writable. |
boolean |
exists()
Determine if this directory file exists. |
java.lang.Object |
getAttribute(java.lang.String key)
Retrieve the value of an attribute for this directory file. |
java.lang.String[] |
getAttributeNames()
Retrieve the attribute names for this directory file. |
java.io.InputStream |
getInputStream()
Get a readable input stream for this directory file. |
java.lang.String |
getName()
Retrieve the name for this directory file. |
java.io.OutputStream |
getOutputStream()
Get a writable output stream for this directory file. |
java.lang.String |
getType()
Retrieve the type of this directory file. |
boolean |
isDirectory()
Determine if this directory file specifies a directory. |
java.util.Date |
lastModified()
Determine the date that this directory file was last modified. |
long |
length()
Determine the length of this directory file. |
void |
makeWritable(boolean flag)
Set the contents of this directory file to be writable. |
void |
setAttribute(java.lang.String attr,
java.lang.Object val)
Set the value of an attribute for this document. |
void |
setLastModified(java.util.Date when)
Set the date that this directory file was last modified. |
void |
setLength(long len)
Set the length of the contents of this directory file. |
void |
setType(java.lang.String type)
Set the type of this directory file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SERIES
protected static final java.lang.String[] s_attrNames
protected java.io.File m_fname
protected FDirectory m_search
protected java.io.InputStream m_in
protected java.io.OutputStream m_out
Constructor Detail |
protected FFile(FDirectory dir, java.io.File fname)
dir
- The directory searcher that created (and owns) this file.fname
- The filename of this file.Method Detail |
public boolean exists()
exists
in interface DocumentI
public boolean isDirectory()
isDirectory
in interface DocumentI
public boolean canRead()
canRead
in interface DocumentI
getInputStream()
public boolean canWrite()
canWrite
in interface DocumentI
getOutputStream()
public void makeWritable(boolean flag) throws java.io.IOException
Note:
Once a file has been set to be unwritable (i.e., to be read-only), it
cannot be reset to writable. (This is a limitation of the underlying
File
class.)
makeWritable
in interface WritableDocumentI
flag
- True if the file is to be made writable, false if it is not.
java.io.IOException
- Thrown if the access mode of the file cannot be altered, or if some
other error occurs.canWrite()
public long length()
length
in interface DocumentI
public void setLength(long len) throws java.lang.UnsupportedOperationException
This operation is not supported.
setLength
in interface WritableDocumentI
len
- The new length (size) of this document, in units meaningful to the
implementation of this interface (typically bytes).
java.lang.UnsupportedOperationException
- (unchecked)
Always thrown, because this method is not implemented for this document
type.length()
public java.util.Date lastModified()
lastModified
in interface DocumentI
public void setLastModified(java.util.Date when) throws java.io.IOException
setLastModified
in interface WritableDocumentI
when
- The new date that this file was last modified. If this is null, no action
it taken.
java.io.IOException
- Thrown if the file time cannot be modified, or if some other error occurs.lastModified()
public java.lang.String getName()
getName
in interface DocumentI
public java.lang.String getType()
getType
in interface DocumentI
public void setType(java.lang.String type) throws java.lang.UnsupportedOperationException
This operation is not supported.
setType
in interface WritableDocumentI
type
- The new type of this document (which can be anything meaningfully
interpreted as a document type, typically a filename extension or
suffix). Such a type name is typically suitable for display by some user
interface.
java.lang.UnsupportedOperationException
- (unchecked)
Always thrown, because this method is not implemented for this document
type.getType()
public java.lang.String[] getAttributeNames()
getAttributeNames
in interface DocumentI
java.lang.Exception
- Thrown if the information about the file is unobtainable, or if some
other error occurs.DocumentI.getAttribute(java.lang.String)
,
DocumentI.setAttribute(java.lang.String, java.lang.Object)
public void addAttribute(java.lang.String name) throws java.lang.UnsupportedOperationException
This operation is not supported.
addAttribute
in interface WritableDocumentI
name
- The name of a new attribute to associate with this document.
java.lang.UnsupportedOperationException
- (unchecked)
Always thrown, because this method is not implemented for this document
type.getAttribute(java.lang.String)
,
setAttribute(java.lang.String, java.lang.Object)
,
getAttributeNames()
public java.lang.Object getAttribute(java.lang.String key)
getAttribute
in interface DocumentI
key
- The name of an attribute associated with this directory file.
The following attribute names are supported:
"file" File "fullpath" String "length" Long "modified" Date "name" String "parent" String "path" String
java.lang.Exception
- Thrown if the information about the file is unobtainable, or if some
other error occurs.DocumentI.getAttributeNames()
public void setAttribute(java.lang.String attr, java.lang.Object val) throws java.lang.UnsupportedOperationException
setAttribute
in interface DocumentI
attr
- The name of an attribute associated with this document.val
- The new value of the specified attribute.
java.lang.UnsupportedOperationException
- (unchecked)
Always thrown, because this method is not implemented for this document
type.DocumentI.getAttributeNames()
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface DocumentI
java.io.IOException
- Thrown if the file cannot be accessed, or if some other error occurs.public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface WritableDocumentI
java.io.IOException
- Thrown if the file cannot be accessed, or if some other error occurs.DocumentI.getInputStream()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |