at.ac.tuwien.infosys.rnue.interfaces
Interface IFileList

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FileListImpl

public interface IFileList
extends java.io.Serializable

A class implementing the IFileList interface represents a list of files which can be reached on a peer with a specific URL prefix.

The class should implement a constructor taking two arguments: The first argument is a java.lang.String representing the protocol, host, and port number of the ShareMe peer to access the files in the FileList. The string must have the following format: {protocol}"://"{host}":"{port} (e.g. "http://pent223.infosys.tuwien.ac.at:10003")
The second parameter is an array of IFile files to be put into the FileList.


Method Summary
 java.util.Enumeration files()
          Returns a java.lang.Enumeartion of the FileList elements.
 java.lang.String getDownloadURLPrefix()
          Returns the URL prefix.
 void printToStream(java.io.OutputStream os)
          Prints the file list elements (path + file name + (size)) on the given java.io.OutputStream.
 int size()
          Returns the number of entries in the file list.
 

Method Detail

files

public java.util.Enumeration files()
Returns a java.lang.Enumeartion of the FileList elements.

Returns:
java.lang.Enumeartion of IFile elements in the list.

getDownloadURLPrefix

public java.lang.String getDownloadURLPrefix()
Returns the URL prefix.

Returns:
URL prefix

size

public int size()
Returns the number of entries in the file list.

Returns:
number of elements

printToStream

public void printToStream(java.io.OutputStream os)
                   throws ShareMeException
Prints the file list elements (path + file name + (size)) on the given java.io.OutputStream.

Parameters:
os - java.io.OutStream to write the file list at.
Throws:
ShareMeException - If no output stream passed to print.