org.alltimeflashdreamer.filelister
Class FileListerEntry

java.lang.Object
  extended byorg.alltimeflashdreamer.filelister.FileListerEntry
All Implemented Interfaces:
org.alltimeflashdreamer.util.Chainable, Serializable

public class FileListerEntry
extends Object
implements Serializable, org.alltimeflashdreamer.util.Chainable

Title: FileListerEntry

Description: Very simple value class to store the attributes of one found and accepted file or directory.

Organization: All Time Flash Dreamer

Version:
0.5.1
Author:
Copyright (c) 2002-2004 by Florian Steinsiepe
See Also:
Serialized Form

Constructor Summary
FileListerEntry(File file, long lLastIndexed, String sNodeID)
          Reads the settings from a File instance.
FileListerEntry(String sName, String sDirectory, long lSizeInBytes, long lLastModified, String sType, long lLastIndexed, String sNodeID)
          Initializes this class with each value.
 
Method Summary
 String getDirectory()
          Returns the directory setting.
 long getLastIndexed()
          Returns the time when the file was found/indexed, as a long.
 long getLastModified()
          Returns the last modification date of this entry, as a long.
 String getName()
          Returns the name setting.
 org.alltimeflashdreamer.util.Chainable getNextEntry()
          Returns the pointer to the next entry of the list, if any.
 String getNodeID()
          Returns the node id of this entry, as defined by the building of the binary tree down from the virtual root directory.
 long getSize()
          Returns the size (in bytes) of this entry.
 String getType()
          Returns the type-specifing string (either "D" for directory or "F" for file).
 boolean isDirectory()
          Returns whether this entry represents a directory or not.
 boolean isFile()
          Returns whether this entry represents a file or not.
 boolean isSelectedForZip()
          Tells whether the user selected this entry for download in a zip.
 void setNextEntry(org.alltimeflashdreamer.util.Chainable nextEntry)
          Sets the pointer to the next file lister entry in the list.
 void setSelectedForZip(boolean bIsSelectedForZip)
          Sets this entry as selected to be downloaded in a zip.
 void setSize(long lSizeInBytes)
          Sets the size (in bytes) of this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileListerEntry

public FileListerEntry(File file,
                       long lLastIndexed,
                       String sNodeID)
Reads the settings from a File instance.
Note: On special circumstances, the getName method of the File class returns null. If so, the name is set to the file's absolute path.

Parameters:
file - the previously found/accepted File
lLastIndexed - the timestamp when the file was found
sNodeID - the node if of the file, as defined by the building of the binary tree down from the virtual root directory

FileListerEntry

public FileListerEntry(String sName,
                       String sDirectory,
                       long lSizeInBytes,
                       long lLastModified,
                       String sType,
                       long lLastIndexed,
                       String sNodeID)
Initializes this class with each value.

Parameters:
sName - the name of the entry
sDirectory - the directory of the entry
lSizeInBytes - the size of the file
lLastModified - the last modification date of the file
sType - the type descriptor ("F" for file or "D" for directory)
lLastIndexed - the timestamp when the file was found
sNodeID - the node if of the file, as defined by the building of the binary tree down from the virtual root directory
Method Detail

getName

public String getName()
Returns the name setting.

Returns:
the name of this entry

getDirectory

public String getDirectory()
Returns the directory setting.

Returns:
the directory name of this entry

getSize

public long getSize()
Returns the size (in bytes) of this entry.

Returns:
the size of this entry

setSize

public void setSize(long lSizeInBytes)
Sets the size (in bytes) of this entry.

Parameters:
lSizeInBytes - the size of this entry

getLastModified

public long getLastModified()
Returns the last modification date of this entry, as a long.

Returns:
the last modification date of this entry

isFile

public boolean isFile()
Returns whether this entry represents a file or not.

Returns:
a file?

isDirectory

public boolean isDirectory()
Returns whether this entry represents a directory or not.

Returns:
a directory?

getType

public String getType()
Returns the type-specifing string (either "D" for directory or "F" for file).

Returns:
the value that represents the type of the entry in the database

getLastIndexed

public long getLastIndexed()
Returns the time when the file was found/indexed, as a long.

Returns:
the timestamp when the file was found

getNodeID

public String getNodeID()
Returns the node id of this entry, as defined by the building of the binary tree down from the virtual root directory.

Returns:
this entry's node id

setNextEntry

public void setNextEntry(org.alltimeflashdreamer.util.Chainable nextEntry)
Sets the pointer to the next file lister entry in the list.

Specified by:
setNextEntry in interface org.alltimeflashdreamer.util.Chainable
Parameters:
nextEntry - the next, preinstantiated FileListerEntry; if null, the this element becomes the last one of the list

getNextEntry

public org.alltimeflashdreamer.util.Chainable getNextEntry()
Returns the pointer to the next entry of the list, if any.

Specified by:
getNextEntry in interface org.alltimeflashdreamer.util.Chainable
Returns:
the next entry or null

isSelectedForZip

public boolean isSelectedForZip()
Tells whether the user selected this entry for download in a zip.

Returns:
to be added to a download zip?

setSelectedForZip

public void setSelectedForZip(boolean bIsSelectedForZip)
Sets this entry as selected to be downloaded in a zip.

Parameters:
bIsSelectedForZip - to be added to a download zip?