com.limegroup.gnutella.settings
Class SharingSettings

java.lang.Object
  extended bycom.limegroup.gnutella.settings.AbstractSettings
      extended bycom.limegroup.gnutella.settings.LimeProps
          extended bycom.limegroup.gnutella.settings.SharingSettings

public class SharingSettings
extends LimeProps

Settings for sharing


Field Summary
static BooleanSetting ALLOW_BROWSER
          Whether or not browsers should be allowed to perform uploads.
static BooleanSetting CLEAR_DOWNLOAD
          Specifies whether or not completed downloads should automatically be cleared from the download window.
static BooleanSetting CLEAR_UPLOAD
          Specifies whether or not completed uploads should automatically be cleared from the upload window.
static java.io.File DEFAULT_SAVE_DIR
           
static FileArraySetting DIRECTORIES_TO_SHARE
          The shared directories (an array of Files!).
static FileSetting DIRECTORY_FOR_SAVING_FILES
          The directory for saving files.
static FileSetting DOWNLOAD_SNAPSHOT_BACKUP_FILE
          A file with a snapshot of current downloading files.
static FileSetting DOWNLOAD_SNAPSHOT_FILE
          A file with a snapshot of current downloading files.
static StringSetting EXTENSIONS_TO_SHARE
          File extensions that are shared.
static IntSetting FREELOADER_ALLOWED
          Sets the probability (expressed as a percentage) that an incoming freeloader will be accepted.
static IntSetting FREELOADER_FILES
          Minimum the number of files a host must share to not be considered a freeloader.
static FileSetting INCOMPLETE_DIRECTORY
          The directory where incomplete files are stored (downloads in progress).
static IntSetting INCOMPLETE_PURGE_TIME
          The minimum age in days for which incomplete files will be deleted.
static IntSetting PERSISTENT_HTTP_CONNECTION_TIMEOUT
          The timeout value for persistent HTTP connections in milliseconds.
 
Fields inherited from class com.limegroup.gnutella.settings.LimeProps
FACTORY
 
Method Summary
static void addDirectory(java.io.File dir)
          Helper method left from SettingsManager.
static java.io.File getSaveDirectory()
          Retrieves the save directory.
static void setDirectories(java.io.File[] files)
          Helper method left from SettingsManager.
static void setSaveDirectory(java.io.File saveDir)
          Helper method left from SettingsManager.
 
Methods inherited from class com.limegroup.gnutella.settings.LimeProps
instance
 
Methods inherited from class com.limegroup.gnutella.settings.AbstractSettings
getFactory, getProperties, getPropertiesFile, getShouldSave, reload, revertToDefault, save, setShouldSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAVE_DIR

public static final java.io.File DEFAULT_SAVE_DIR

DIRECTORY_FOR_SAVING_FILES

public static final FileSetting DIRECTORY_FOR_SAVING_FILES
The directory for saving files.


INCOMPLETE_DIRECTORY

public static final FileSetting INCOMPLETE_DIRECTORY
The directory where incomplete files are stored (downloads in progress).


DOWNLOAD_SNAPSHOT_FILE

public static final FileSetting DOWNLOAD_SNAPSHOT_FILE
A file with a snapshot of current downloading files.


DOWNLOAD_SNAPSHOT_BACKUP_FILE

public static final FileSetting DOWNLOAD_SNAPSHOT_BACKUP_FILE
A file with a snapshot of current downloading files.


INCOMPLETE_PURGE_TIME

public static final IntSetting INCOMPLETE_PURGE_TIME
The minimum age in days for which incomplete files will be deleted. This values may be zero or negative; doing so will cause LimeWire to delete ALL incomplete files on startup.


CLEAR_DOWNLOAD

public static final BooleanSetting CLEAR_DOWNLOAD
Specifies whether or not completed downloads should automatically be cleared from the download window.


DIRECTORIES_TO_SHARE

public static final FileArraySetting DIRECTORIES_TO_SHARE
The shared directories (an array of Files!).


EXTENSIONS_TO_SHARE

public static final StringSetting EXTENSIONS_TO_SHARE
File extensions that are shared.


FREELOADER_ALLOWED

public static final IntSetting FREELOADER_ALLOWED
Sets the probability (expressed as a percentage) that an incoming freeloader will be accepted. For example, if allowed==50, an incoming connection has a 50-50 chance being accepted. If allowed==100, all incoming connections are accepted.


FREELOADER_FILES

public static final IntSetting FREELOADER_FILES
Minimum the number of files a host must share to not be considered a freeloader. For example, if files==0, no host is considered a freeloader.


PERSISTENT_HTTP_CONNECTION_TIMEOUT

public static final IntSetting PERSISTENT_HTTP_CONNECTION_TIMEOUT
The timeout value for persistent HTTP connections in milliseconds.


CLEAR_UPLOAD

public static final BooleanSetting CLEAR_UPLOAD
Specifies whether or not completed uploads should automatically be cleared from the upload window.


ALLOW_BROWSER

public static final BooleanSetting ALLOW_BROWSER
Whether or not browsers should be allowed to perform uploads.

Method Detail

setSaveDirectory

public static final void setSaveDirectory(java.io.File saveDir)
                                   throws java.io.IOException
Helper method left from SettingsManager. Sets the directory for saving files.

Modifies: DIRECTORY_FOR_SAVING_FILES, INCOMPLETE_DIRECTORY, DOWNLOAD_SNAPSHOT_FILE

Parameters:
saveDir - A File instance denoting the abstract pathname of the directory for saving files.
Throws:
IOException - If the directory denoted by the directory pathname String parameter did not exist prior to this method call and could not be created, or if the canonical path could not be retrieved from the file system.
NullPointerException - If the "dir" parameter is null.
java.io.IOException

getSaveDirectory

public static final java.io.File getSaveDirectory()
Retrieves the save directory. If it is blank, it uses a 'default' directory. This is used instead of the setting to ensure that the save directory is always saved to the user's file.


addDirectory

public static final void addDirectory(java.io.File dir)
                               throws java.io.IOException
Helper method left from SettingsManager. Adds one directory to the directory string only if it is a directory and is not already listed.

Modifies: DIRECTORIES_TO_SHARE

Parameters:
dir - a File instance denoting the abstract pathname of the new directory to add
Throws:
java.io.IOException - if the directory denoted by the directory pathname String parameter did not exist prior to this method call and could not be created, or if the canonical path could not be retrieved from the file system

setDirectories

public static final void setDirectories(java.io.File[] files)
                                 throws java.io.IOException
Helper method left from SettingsManager. Sets the shared directories. This method filters out any duplicate or invalid directories in the string. Note, however, that it does not currently filter out listing subdirectories that have parent directories also in the string.

Modifies: DIRECTORIES_TO_SHARE

Throws:
java.io.IOException