⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 download.java

📁 基于JXTA开发平台的下载软件开发源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
	
	public void
	remove(
		boolean	delete_torrent,
		boolean	delete_data )
	
		throws DownloadException, DownloadRemovalVetoException;

	/**
	 * Returns the current position in the queue
	 * Completed and Incompleted downloads have seperate position sets.  This means
	 * we can have a position x for Completed, and position x for Incompleted.
   *
   * @since 2.0.8.0
	 */
	public int
	getPosition();
	
		/**
		 * returns the time this download was created in milliseconds
		 * @return
		 */
	
	public long
	getCreationTime();
	
	/**
	 * Sets the position in the queue
	 * Completed and Incompleted downloads have seperate position sets
   *
   * @since 2.0.8.0
	 */
	public void
	setPosition(
		int newPosition);

	/**
	 * Moves the download position up one
   *
   * @since 2.1.0.0
	 */
	public void
	moveUp();
	
	/**
	 * Moves the download down one position
   *
   * @since 2.1.0.0
	 */
	public void
	moveDown();
	
		/**
		 * Moves a download and re-orders the others appropriately. Note that setPosition does not do this, it
		 * merely sets the position thus making it possible, for example, for two downloads to have the same
		 * position 
		 * @param position
		 * @since 2.3.0.7
		 */
	
	public void
	moveTo(
		int		position );
	
	/**
	 * Tests whether or not a download can be removed. Due to synchronization issues it is possible
	 * for a download to report OK here but still fail removal.
	 * @return
	 * @throws DownloadRemovalVetoException
   *
   * @since 2.0.7.0
	 */
	public boolean
	canBeRemoved()
	
		throws DownloadRemovalVetoException;
	
	public void
	setAnnounceResult(
		DownloadAnnounceResult	result );
	
	public void
	setScrapeResult(
		DownloadScrapeResult	result );
	
	/**
	 * Gives access to the last announce result received from the tracker for the download
	 * @return
   *
   * @since 2.0.7.0
	 */
	
	public DownloadAnnounceResult
	getLastAnnounceResult();
	
	/**
	 * Gives access to the last scrape result received from the tracker for the download
	 * @return a non-null DownloadScrapeResult
   *
   * @since 2.0.7.0
	 */
	public DownloadScrapeResult
	getLastScrapeResult();
	
	/**
	 * Gives access to the download's statistics
	 * @return
   *
   * @since 2.0.7.0
	 */
	public DownloadStats
	getStats();
	
	/** Downloads can be persistent (be remembered accross Azureus sessions), or
	 * non-persistent.
	 *
	 * @return true - persistent<br>
	 *         false - non-persistent
     *
     * @since 2.1.0.0
	 */
	
    public boolean
    isPersistent();
  
    /**
     * Sets the maximum download speed in bytes per second. 0 -> unlimited
     * @since 2.1.0.2
     * @param kb
     */
    
  	public void
	setMaximumDownloadKBPerSecond(
		int		kb );
  	
  	public int
	getMaximumDownloadKBPerSecond();
    
    
    /**
     * Get the max upload rate allowed for this download.
     * @return upload rate in bytes per second, 0 for unlimited, -1 for upload disabled
     */
    public int getUploadRateLimitBytesPerSecond();
    
    /**
     * Set the max upload rate allowed for this download.
     * @param max_rate_bps limit in bytes per second, 0 for unlimited, -1 for upload disabled
     */
    public void setUploadRateLimitBytesPerSecond( int max_rate_bps );
    

  	/**
  	 * indicates if the download has completed or not 
  	 * @return
  	 * @since 2.1.0.4
  	 */
  	
  	public boolean
	isComplete();
  	
  		/**
  		 * When a download is completed it is rechecked (if the option is enabled). This method
  		 * returns true during this phase (at which time the status will be seeding)
  		 * @return
  		 * @since 2.3.0.6
  		 */
  	
	public boolean
 	isChecking();
	
  	public String
	getSavePath();
  	
  		/**
  		 * Move a download's data files to a new location. Download must be stopped and persistent
  		 * @since 2.3.0.5
  		 * @param new_parent_dir
  		 * @throws DownloadException
  		 */
  	
  	public void
  	moveDataFiles(
  		File	new_parent_dir )
  	
  		throws DownloadException;
  	
  		/**
		 * Move a download's torrent file to a new location. Download must be stopped and persistent
		 * @since 2.3.0.5
		 * @param new_parent_dir
		 * @throws DownloadException
		 */
  	
  	public void
  	moveTorrentFile(
  		File	new_parent_dir ) 
  	
  		throws DownloadException;
  	
  		/**
  		 * return the current peer manager for the download. 
  		 * @return	null returned if torrent currently doesn't have one (e.g. it is stopped)
  		 */
  	
  	public PeerManager
	getPeerManager();
  	
		/**
		 * Return the disk manager, null if its not running
		 * @return
		 * @since 2.3.0.1
		 */
	
	public DiskManager
	getDiskManager();
	
		/**
		 * Returns info about the torrent's files. Note that this will return "stub" values if the 
		 * download isn't running (not including info such as completion status)
		 * @return
		 * @since 2.3.0.1
		 */
	
	public DiskManagerFileInfo[]
	getDiskManagerFileInfo();
	
  		/**
  		 * request a tracker announce 
  		 * @since 2.1.0.5
  		 */
  	
  	public void
	requestTrackerAnnounce();
  	
  		/**
		 * request a tracker announce 
		 * @since 2.3.0.7
		 */
  	
 	public void
	requestTrackerAnnounce(
		boolean		immediate );
 	
		/**
		 * request a tracker announce 
		 * @since 2.3.0.7
		 */
 	
	public void
	requestTrackerScrape(
		boolean		immediate );
	
	/**
	 * Adds a listener to the download that will be informed of changes in the download's state
	 * @param l
   *
   * @since 2.0.7.0
	 */
	public void
	addListener(
		DownloadListener	l );
	
	/**
	 * Removes listeners added above
	 * @param l
   *
   * @since 2.0.7.0
	 */
	public void
	removeListener(
		DownloadListener	l );

	/**
	 * Adds a listener that will be informed when the latest announce/scrape results change
	 * @param l
   *
   * @since 2.0.7.0
	 */
	public void
	addTrackerListener(
		DownloadTrackerListener	l );
	
	/**
	 * Removes listeners added above
	 * @param l
   *
   * @since 2.0.7.0
	 */
	public void
	removeTrackerListener(
		DownloadTrackerListener	l );
	
	/**
	 * Adds a listener that will be informed when a download is about to be removed. This gives
	 * the implementor the opportunity to veto the removal
	 * @param l
   *
   * @since 2.0.7.0
	 */
	public void
	addDownloadWillBeRemovedListener(
		DownloadWillBeRemovedListener	l );
	
	/**
	 * Removes the listener added above
	 * @param l
   *
   * @since 2.0.7.0
	 */
	public void
	removeDownloadWillBeRemovedListener(
		DownloadWillBeRemovedListener	l );
	
	/**
	 * Adds a listener to the download that will be informed of 
	 * @param l
   *
   * @since 2.1.0.0
	 */
	public void
	addPeerListener(
		DownloadPeerListener	l );
	
	/**
	 * Removes listeners added above
	 * @param l
   *
   * @since 2.1.0.0
	 */
	public void
	removePeerListener(
		DownloadPeerListener	l );

	/**
	 * The torrents with the highest rankings will be seeded first.
	 * 
	 * @return Seeding Rank
	 */
	public int getSeedingRank();

	/**
	 * The torrents with the highest rankings will be seeded first.
	 * 
	 * @param rank New Ranking
	 */
	public void setSeedingRank(int rank);
  
	public void
	addPropertyListener(
		DownloadPropertyListener	l );
	
	public void
	removePropertyListener(
		DownloadPropertyListener	l );
	
  /**
   * Get the local peerID advertised to the download swarm.
   * @return self peer id
   * 
   * @since 2.1.0.5
   */
  public byte[] getDownloadPeerId();
  
  /**
   * Is advanced AZ messaging enabled for this download.
   * @return true if enabled, false if disabled
   */
  public boolean isMessagingEnabled();
  
  /**
   * Enable or disable advanced AZ messaging for this download.
   * @param enabled true to enabled, false to disabled
   */
  public void setMessagingEnabled( boolean enabled );
  
  
  /**
   * Set the authenticator that will be used by this download to handle secure torrent session
   * handshaking and data encryption/decryption.
   * @param auth handler
   */
  public void setSessionAuthenticator( SessionAuthenticator auth );
  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -