lhmc.files
Class FileManager

java.lang.Object
  extended by lhmc.files.FileManager

public class FileManager
extends java.lang.Object

FileManager uses the SortedTreeNode class to keep que current directory (with filtred files) in order.

Version:
0.01 Jun 2007
Author:
Cristina Roura Claver

Constructor Summary
FileManager(java.net.URL[] files)
          Constructs the file manager from a URL array.
 
Method Summary
 void changeTreeNode(java.net.URL[] files)
          Changes to a new URL array and the tree node.
 java.net.URL getFileAt(int index)
          Gets the URL at the certain position of the tree.
 java.lang.String getFileNameAt(int index)
          Gets the file path of a node at index position.
 int getNodesNumber()
          Gets the number of nodes of the sorted tree.
 int getUrlType()
          Gets the url type, it can be File or SmbFile
 boolean isDirectoryNode(int index)
          Returns true if at the index position there is a directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManager

public FileManager(java.net.URL[] files)
Constructs the file manager from a URL array.

Parameters:
files - The array of URLs to create the tree with.
Method Detail

getUrlType

public int getUrlType()
Gets the url type, it can be File or SmbFile


changeTreeNode

public void changeTreeNode(java.net.URL[] files)
Changes to a new URL array and the tree node.

Parameters:
files - The new array of URLs to create the tree with.

isDirectoryNode

public boolean isDirectoryNode(int index)
Returns true if at the index position there is a directory.

Parameters:
index - The index position of a node.
Returns:
true if at the index position there is a directory.

getNodesNumber

public int getNodesNumber()
Gets the number of nodes of the sorted tree.

Returns:
The number of nodes.

getFileNameAt

public java.lang.String getFileNameAt(int index)
Gets the file path of a node at index position.

Parameters:
index - The index position of a node.
Returns:
The file path.

getFileAt

public java.net.URL getFileAt(int index)
Gets the URL at the certain position of the tree.

Parameters:
index - The position of the URL in the tree.
Returns:
The file.