org.gudy.azureus2.core3.internat
Class LocaleTorrentUtil

java.lang.Object
  extended by org.gudy.azureus2.core3.internat.LocaleTorrentUtil

public class LocaleTorrentUtil
extends Object

Locale functions specific to Torrents.


Constructor Summary
LocaleTorrentUtil()
           
 
Method Summary
static void addListener(LocaleUtilListener l)
           
static String getCurrentTorrentEncoding(TOTorrent torrent)
           
protected static LocaleUtilDecoderCandidate[] getTorrentCandidates(TOTorrent torrent)
          Checks the Torrent's text fields (path, comment, etc) against a list of locals, returning only those that can handle all the fields.
static LocaleUtilDecoder getTorrentEncoding(TOTorrent torrent)
          Get the torrent's encoding, prompting the user to choose from a list if needed.
static LocaleUtilDecoder getTorrentEncoding(TOTorrent torrent, boolean saveToFileAllowed)
           
static LocaleUtilDecoder getTorrentEncodingIfAvailable(TOTorrent torrent)
          Retrieves the encoding of the torrent if it can be determined.
static void removeListener(LocaleUtilListener l)
           
static void setDefaultTorrentEncoding(TOTorrent torrent)
           
static void setTorrentEncoding(TOTorrent torrent, String encoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleTorrentUtil

public LocaleTorrentUtil()
Method Detail

getTorrentEncodingIfAvailable

public static LocaleUtilDecoder getTorrentEncodingIfAvailable(TOTorrent torrent)
                                                       throws TOTorrentException,
                                                              UnsupportedEncodingException
Retrieves the encoding of the torrent if it can be determined.
Does not prompt the user with choices.

Parameters:
torrent - Torrent to get encoding of
Returns:
Locale torrent is in
Throws:
TOTorrentException
UnsupportedEncodingException

getTorrentEncoding

public static LocaleUtilDecoder getTorrentEncoding(TOTorrent torrent)
                                            throws TOTorrentException,
                                                   UnsupportedEncodingException
Get the torrent's encoding, prompting the user to choose from a list if needed.

Parameters:
torrent - Torrent to get encoding of
Returns:
LocaleUtilDecoder that the torrent is in
Throws:
TOTorrentException
UnsupportedEncodingException

getTorrentEncoding

public static LocaleUtilDecoder getTorrentEncoding(TOTorrent torrent,
                                                   boolean saveToFileAllowed)
                                            throws TOTorrentException,
                                                   UnsupportedEncodingException
Throws:
TOTorrentException
UnsupportedEncodingException

getTorrentCandidates

protected static LocaleUtilDecoderCandidate[] getTorrentCandidates(TOTorrent torrent)
                                                            throws TOTorrentException,
                                                                   UnsupportedEncodingException
Checks the Torrent's text fields (path, comment, etc) against a list of locals, returning only those that can handle all the fields.

Parameters:
torrent -
Returns:
Throws:
TOTorrentException
UnsupportedEncodingException

setTorrentEncoding

public static void setTorrentEncoding(TOTorrent torrent,
                                      String encoding)
                               throws LocaleUtilEncodingException
Throws:
LocaleUtilEncodingException

setDefaultTorrentEncoding

public static void setDefaultTorrentEncoding(TOTorrent torrent)
                                      throws LocaleUtilEncodingException
Throws:
LocaleUtilEncodingException

getCurrentTorrentEncoding

public static String getCurrentTorrentEncoding(TOTorrent torrent)

addListener

public static void addListener(LocaleUtilListener l)

removeListener

public static void removeListener(LocaleUtilListener l)