com.mindtree.techworks.insight.download
Class Fileset

java.lang.Object
  extended by com.mindtree.techworks.insight.download.Fileset
Direct Known Subclasses:
FTPFileset, HTTPFileset, SFTPFileset

public class Fileset
extends java.lang.Object

Fileset is a data object. It contains the information for a list of files that can be downloaded for a particular source.

Version:
$Revision: 27 $ $Date: 2007-12-16 04:58:03 -0700 (Sun, 16 Dec 2007) $
Author:
Balaji Seshadri, Bindul Bhowmik

Field Summary
static int FTP_FILESET
          Identifies the fileset as an FTP Fileset
static int HTTP_FILESET
          Identifies the fileset as a HTTP Fileset
static int LOCAL_FILESET
          Constants that identify the supported file types
static int SFTP_FILESET
          Identifies the fileset as an SFTP Fileset
 
Constructor Summary
Fileset(java.lang.String filesetName, int type)
          Creates a Fileset object with the passed name
Fileset(java.lang.String filesetName, int type, java.lang.String typeString)
          Creates a fileset object with the passed parameters
 
Method Summary
 void addFile(java.lang.String fileName)
          Adds a filename to the list of files
 java.lang.String getFile(int index)
          Returns the file at the index specified.
 int getFileCount()
          Returns the number of files in the Fileset.
 java.util.List getFileList()
          Returns the list of files.
 java.lang.String getFilesetName()
           
 int getType()
          Returns the type of the fileset.
 java.lang.String getTypeString()
           
 java.util.Iterator iterateFiles()
          Returns an iterator for the files in the Fileset.
 void setFileList(java.util.List fileList)
          sets the file list for the Fileset
 void setTypeString(java.lang.String typeString)
           
 java.lang.String toString()
          Returns the information about this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCAL_FILESET

public static final int LOCAL_FILESET
Constants that identify the supported file types

See Also:
Constant Field Values

FTP_FILESET

public static final int FTP_FILESET
Identifies the fileset as an FTP Fileset

See Also:
Constant Field Values

HTTP_FILESET

public static final int HTTP_FILESET
Identifies the fileset as a HTTP Fileset

See Also:
Constant Field Values

SFTP_FILESET

public static final int SFTP_FILESET
Identifies the fileset as an SFTP Fileset

See Also:
Constant Field Values
Constructor Detail

Fileset

public Fileset(java.lang.String filesetName,
               int type)
Creates a Fileset object with the passed name

Parameters:
filesetName - the name of the fileset.
type - identifies the type of the fileset. Should be one of the type constants defined in this class.

Fileset

public Fileset(java.lang.String filesetName,
               int type,
               java.lang.String typeString)
Creates a fileset object with the passed parameters

Parameters:
filesetName - the name of the fileset.
type - identifies the type of the fileset. Should be one of the type constants defined in this class.
typeString - String identifying the type
Method Detail

getTypeString

public java.lang.String getTypeString()
Returns:
Returns the typeString.

setTypeString

public void setTypeString(java.lang.String typeString)
Parameters:
typeString - The typeString to set.

getFilesetName

public java.lang.String getFilesetName()
Returns:
Returns the filesetName.

getType

public int getType()
Returns the type of the fileset.

Returns:
The type of the fileset.

setFileList

public void setFileList(java.util.List fileList)
sets the file list for the Fileset

Parameters:
fileList - list for the Fileset

getFileList

public java.util.List getFileList()
Returns the list of files. If no files are present, it returns an empty ArrayList

Returns:
List list of files for the Fileser

addFile

public void addFile(java.lang.String fileName)
Adds a filename to the list of files

Parameters:
fileName -

getFileCount

public int getFileCount()
Returns the number of files in the Fileset.

Returns:
The count of files in the Fileset

getFile

public java.lang.String getFile(int index)
Returns the file at the index specified.

Parameters:
index - The index from where to get the file.
Returns:
The file at the index specified.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If no files are present or no file is present at the index specified.

iterateFiles

public java.util.Iterator iterateFiles()
Returns an iterator for the files in the Fileset. If no files are present, it returns an empty iterator.

Returns:
An iterator for the files in the fileList. If no files are present, returns and empty iterator.

toString

public java.lang.String toString()
Returns the information about this object.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2003-2008 MindTree Consulting Ltd.. All Rights Reserved.