org.eclipse.ecf.protocol.bittorrent
Class TorrentConfiguration

java.lang.Object
  extended by org.eclipse.ecf.protocol.bittorrent.TorrentConfiguration

public final class TorrentConfiguration
extends java.lang.Object

A class used to define properties and configurations such as specifying where a torrent's state information should be stored and how debugging messages should be displayed.


Nested Class Summary
static interface TorrentConfiguration.IDebugListener
          An interface to setup an outlet for debugging messages.
 
Field Summary
static boolean DEBUG
          A boolean flag to specify whether debugging output should be printed or not.
 
Method Summary
static void debug(java.lang.String message)
          This method is called by classes that wishes to log a message to the TorrentConfiguration.IDebugListener that was set with setDebugListener(org.eclipse.ecf.protocol.bittorrent.TorrentConfiguration.IDebugListener).
static void remove(java.lang.String hexHash)
          Removes saved information regarding a torrent's progress and status based on its hexadecimal hash value.
static void setConfigurationPath(java.io.File directory)
          Sets the directory to use to save configuration and status information when starting up torrents.
static void setDebugListener(TorrentConfiguration.IDebugListener listener)
          Sets the listener that will be notified of debugging messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
A boolean flag to specify whether debugging output should be printed or not.

Method Detail

debug

public static void debug(java.lang.String message)
This method is called by classes that wishes to log a message to the TorrentConfiguration.IDebugListener that was set with setDebugListener(org.eclipse.ecf.protocol.bittorrent.TorrentConfiguration.IDebugListener).

Parameters:
message - the message to print out

setDebugListener

public static void setDebugListener(TorrentConfiguration.IDebugListener listener)
Sets the listener that will be notified of debugging messages.

Parameters:
listener - the listener to use, or null if the previously set listener should be discarded

setConfigurationPath

public static void setConfigurationPath(java.io.File directory)
Sets the directory to use to save configuration and status information when starting up torrents. Note that the configuration path cannot be modified again with a second invocation of this method.

Parameters:
directory - the directory to save the states into
Throws:
java.lang.IllegalArgumentException - If directory is null, a file and not a directory, cannot be written, or could not be created

remove

public static void remove(java.lang.String hexHash)
Removes saved information regarding a torrent's progress and status based on its hexadecimal hash value.

Parameters:
hexHash - the hexadecimal hash value of the torrent
Throws:
java.lang.IllegalArgumentException - If hexHash is null