Methods Summary |
---|
protected void | delete()
resource.deleteTorrent(this);
|
protected static org.gudy.azureus2.pluginsimpl.local.sharing.ShareItemImpl | deserialiseItem(ShareResourceImpl resource, java.util.Map map)
try{
byte[] hash = (byte[])map.get( "ihash");
String save_location = new String((byte[])map.get("ifile"), Constants.DEFAULT_ENCODING );
return( new ShareItemImpl(resource,hash,save_location));
}catch( UnsupportedEncodingException e ){
throw( new ShareException( "internal error", e ));
}
|
public byte[] | getFingerPrint()
return( fingerprint );
|
public org.gudy.azureus2.plugins.torrent.Torrent | getTorrent()
// TODO: we don't want to hold all torrents in memory. we probably want to
// create a TorrentFacade that caches enough data to run, say, the sharing UI
// and then load the torrent from file on demand.
if( torrent == null ){
resource.readTorrent(this);
}
return( torrent );
|
public java.io.File | getTorrentFile()
return( resource.getTorrentFile(this));
|
protected java.lang.String | getTorrentLocation()
return( torrent_save_location );
|
protected void | serialiseItem(java.util.Map map)
map.put( "ihash", fingerprint );
try{
map.put( "ifile", torrent_save_location.getBytes( Constants.DEFAULT_ENCODING ) );
}catch( UnsupportedEncodingException e ){
Debug.printStackTrace( e );
}
|
protected void | setTorrent(org.gudy.azureus2.plugins.torrent.Torrent _torrent)
torrent = _torrent;
|
protected void | writeTorrent()
if ( torrent_save_location == null ){
torrent_save_location = resource.getNewTorrentLocation();
}
resource.writeTorrent( this );
|