Methods Summary |
---|
protected void | checkComponents()
for (int i=0;i<path_components.length;i++){
byte[] comp = path_components[i];
if ( comp.length == 2 &&
comp[0] == (byte)'." &&
comp[1] == (byte)'." ){
throw( new TOTorrentException(
"Torrent file contains illegal '..' component",
TOTorrentException.RT_DECODE_FAILS ));
}
}
|
protected java.util.Map | getAdditionalProperties()
return( additional_properties );
|
public int | getFirstPieceNumber()
return( first_piece_number );
|
public int | getLastPieceNumber()
return( last_piece_number );
|
public long | getLength()
return( file_length );
|
public int | getNumberOfPieces()
return( getLastPieceNumber() - getFirstPieceNumber() + 1 );
|
public byte[][] | getPathComponents()
return( path_components );
|
public java.lang.String | getRelativePath()
if (torrent == null)
return "";
String sRelativePath = "";
LocaleUtilDecoder decoder = null;
try {
decoder = LocaleTorrentUtil.getTorrentEncodingIfAvailable(torrent);
} catch (Exception e) {
// Do Nothing
}
if (decoder != null) {
for (int j = 0; j < path_components.length; j++) {
try {
String comp;
try {
comp = decoder.decodeString(path_components[j]);
} catch (UnsupportedEncodingException e) {
System.out.println("file - unsupported encoding!!!!");
try {
comp = new String(path_components[j]);
} catch (Exception e2) {
comp = "UnsupportedEncoding";
}
}
comp = FileUtil.convertOSSpecificChars(comp);
sRelativePath += (j == 0 ? "" : File.separator) + comp;
} catch (Exception ex) {
Debug.out(ex);
}
}
}
return sRelativePath;
|
public TOTorrent | getTorrent()
return( torrent );
|
protected boolean | isUTF8()
return( is_utf8 );
|
protected void | setAdditionalProperty(java.lang.String name, java.lang.Object value)
additional_properties.put( name, value );
|