com.sun.labs.minion
Class IndexableFile

java.lang.Object
  extended by java.io.File
      extended by com.sun.labs.minion.IndexableFile
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>

public class IndexableFile
extends java.io.File

An extension of File that stores the encoding used for the file. If no encoding is provided by the application, then the system default encoding is used, if it can be determined. If that encoding cannot be determined, then an encoding of UTF-8 will be used.

See Also:
Serialized Form

Nested Class Summary
static class IndexableFile.Type
           
 
Field Summary
protected  java.lang.String encoding
          The encoding for the file
protected  java.lang.String exactPath
          The exact path that we were passed, so we can handle things that aren't files, like zip archives.
protected  IndexableFile.Type markupType
          The markup type that is contained in this file.
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
IndexableFile(IndexableFile parent, java.lang.String child)
          Creates a new IndexableFile that is the child of a parent IndexableFile.
IndexableFile(java.lang.String pathname)
          Creates an IndexableFile from an absolute pathname
IndexableFile(java.lang.String pathname, java.lang.String encoding)
          Creates an indexable file for an absolute pathname with a specified encoding
IndexableFile(java.lang.String parent, java.lang.String child, java.lang.String encoding)
          Creates a new IndexableFile that is the child of a parent IndexableFile with a specified encoding.
 
Method Summary
 java.lang.String getEncoding()
          Gets the encoding value.
 java.lang.String getExactPathname()
          Returns the pathname for the file, exactly as it was passed.
 IndexableFile.Type getMarkupType()
          Gets the markupType value.
 void setEncoding(java.lang.String encoding)
          Sets the encoding value.
 void setMarkupType(IndexableFile.Type markupType)
          Sets the markupType value.
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

encoding

protected java.lang.String encoding
The encoding for the file


exactPath

protected java.lang.String exactPath
The exact path that we were passed, so we can handle things that aren't files, like zip archives.


markupType

protected IndexableFile.Type markupType
The markup type that is contained in this file. Setting this takes the guesswork out.

Constructor Detail

IndexableFile

public IndexableFile(IndexableFile parent,
                     java.lang.String child)
Creates a new IndexableFile that is the child of a parent IndexableFile.

Parameters:
parent - The IndexableFile that is the parent of the newly created IndexableFile
child - The name of the IndexableFile that is the child of the existing parent

IndexableFile

public IndexableFile(java.lang.String pathname)
Creates an IndexableFile from an absolute pathname

Parameters:
pathname - An absolute pathname for an IndexableFile

IndexableFile

public IndexableFile(java.lang.String pathname,
                     java.lang.String encoding)
Creates an indexable file for an absolute pathname with a specified encoding

Parameters:
pathname - An absolute pathname for an IndexableFile
encoding - The encoding for the file

IndexableFile

public IndexableFile(java.lang.String parent,
                     java.lang.String child,
                     java.lang.String encoding)
Creates a new IndexableFile that is the child of a parent IndexableFile with a specified encoding.

Parameters:
parent - The IndexableFile that is the parent of the newly created IndexableFile
child - The name of the IndexableFile that is the child of the existing parent
encoding - The encoding for the indexable file
Method Detail

getEncoding

public java.lang.String getEncoding()
Gets the encoding value.

Returns:
the encoding value.

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the encoding value.

Parameters:
encoding - The new encoding value.

getExactPathname

public java.lang.String getExactPathname()
Returns the pathname for the file, exactly as it was passed.

Returns:
a string that provides the exact pathname of the indexablefile

getMarkupType

public IndexableFile.Type getMarkupType()
Gets the markupType value.

Returns:
the markupType value.

setMarkupType

public void setMarkupType(IndexableFile.Type markupType)
Sets the markupType value. Setting the markup type will cause the engine to assume the file is of the specified type. An appropriate analyzer will be used to index the file. Leaving the type as PLAIN (the default) will use the regular logic for determining the type.

Parameters:
markupType - The new markupType value.