com.superhac.JXBStreamer.Core
Class DirectoryHandlerObject

java.lang.Object
  extended by com.superhac.JXBStreamer.Core.DirectoryHandlerObject

public class DirectoryHandlerObject
extends java.lang.Object

The DirectoryHandlerObject maps directories to handles and provides services for fulfilling client requests on directories. E.g. get a list of files in a directory.

More information can be found at Superhac.com


Constructor Summary
protected DirectoryHandlerObject(int handle, java.util.ArrayList<java.io.File> virtualRoot)
          Only use this constructor if its the virtual root directory.
protected DirectoryHandlerObject(int handle, java.io.File path)
          All regular non-Virtual root paths will use this constructor.
 
Method Summary
protected  java.lang.String[] getEntryDataByIndex(int index)
          Gets a specfic directory item specified by index.
protected  java.io.File getFileByIndex(int index)
          This gets the File Object for the index number requested.
protected  int getFileIndexNumber(java.lang.String name)
          Gets the file index number of the named file within the directory.
protected  int getHandle()
          Get the handle number for this directory.
protected  java.lang.String[] getNextEntry()
          Gets the next directory item(file) requested by the client.
protected  java.io.File getPath()
          Gets the path(File) represented by this DirectoryHandlerObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryHandlerObject

protected DirectoryHandlerObject(int handle,
                                 java.io.File path)
All regular non-Virtual root paths will use this constructor.

Parameters:
handle - the handle assigned to this path.
path - the acutal directory path.

DirectoryHandlerObject

protected DirectoryHandlerObject(int handle,
                                 java.util.ArrayList<java.io.File> virtualRoot)
Only use this constructor if its the virtual root directory.

Parameters:
handle - handle the handle assigned to this path.
virtualRoot - The virtual root File list.
Method Detail

getHandle

protected int getHandle()
Get the handle number for this directory.

Returns:
The handle number.

getNextEntry

protected java.lang.String[] getNextEntry()
Gets the next directory item(file) requested by the client.

Returns:
String[0] is the name of the file, String[1] = contains the XML data for client response.

getFileIndexNumber

protected int getFileIndexNumber(java.lang.String name)
Gets the file index number of the named file within the directory.

Parameters:
name - The name of the file
Returns:
the index number of the requested filename.

getEntryDataByIndex

protected java.lang.String[] getEntryDataByIndex(int index)
Gets a specfic directory item specified by index.

Parameters:
index - The index number of the requested file. Get from getFileIndexNumber(String name).
Returns:
String[0] is the name of the file, String[1] = contains the XML data for client response.

getFileByIndex

protected java.io.File getFileByIndex(int index)
This gets the File Object for the index number requested.

Parameters:
index - The index number of the requested file. Get from getFileIndexNumber(String name).
Returns:
The file object of the request.

getPath

protected java.io.File getPath()
Gets the path(File) represented by this DirectoryHandlerObject.

Returns:
The path.