Package org.gudy.azureus2.plugins.download

Examples of org.gudy.azureus2.plugins.download.DownloadManager


            e.printStackTrace();
        }
    }
   
    public static void setForceSeed(final String name){
        DownloadManager dm;
        dm = View.getPluginInterface().getDownloadManager();
        Download download[] = dm.getDownloads();
        for(int i = 0; i < download.length ; i++){
            if(download[i].getName().equalsIgnoreCase(name)){
                try{
                    if(download[i].getState() == Download.ST_STOPPED){
                        download[i].setForceStart(true);
View Full Code Here


    }
   
   
   
    public static void removeLastSeed(final String name){
        DownloadManager dm;
        dm = View.getPluginInterface().getDownloadManager();
        Download download[] = dm.getDownloads();
        for(int i = 0; i < download.length ; i++){
            if(download[i].getName().equalsIgnoreCase(name)){
                try{
                    if(download[i].isForceStart()){
                        download[i].setForceStart(false);
View Full Code Here

        altget.start();
       
    }
   
    public static void removeDownload(final String name, final PluginInterface pm){
        final DownloadManager dm;
        dm = pm.getDownloadManager();
        View.DML_BOOLEAN = false;
            DownloadManagerListener dml = new DownloadManagerListener()
            {
                public void
                downloadAdded(
                final Download  download )
                {
                                   
                    if(download.getName().equals(name))
                    {
                        View.DML_BOOLEAN = true;
                        try
                        {
                            if(download.getState() != Download.ST_STOPPED)
                                download.stop();
                            download.remove(true,true);
                            dm.removeListener(this);
                           
                        } catch (DownloadException e) {
                            e.printStackTrace();
                        } catch (DownloadRemovalVetoException e1) {
                            e1.printStackTrace();
                        }
                    }
                    dm.removeListener(this);
                }
                    public void
                    downloadRemoved(
                        Download    download )
                    {
                       
                }
            };
       

            dm.addListener(dml);
       
    }  
View Full Code Here

       
       
    }
   
    public static void removeDownload(final String name, final PluginInterface pm){
        final DownloadManager dm;
        dm = pm.getDownloadManager();
        View.DML_BOOLEAN = false;
            DownloadManagerListener dml = new DownloadManagerListener()
            {
                public void
                downloadAdded(
                final Download  download )
                {
                                   
                    if(download.getName().equals(name))
                    {
                        View.DML_BOOLEAN = true;
                        try
                        {
                            if(download.getState() != Download.ST_STOPPED)
                                download.stop();
                            download.remove(true,true);
                            dm.removeListener(this);
                           
                        } catch (DownloadException e) {
                            e.printStackTrace();
                        } catch (DownloadRemovalVetoException e1) {
                            e1.printStackTrace();
                        }
                    }
                    dm.removeListener(this);
                }
                    public void
                    downloadRemoved(
                        Download    download )
                    {
                       
                }
            };
       

            dm.addListener(dml);
       
    }  
View Full Code Here

}



public static void remove_any_downloads(final String name){
    final DownloadManager dm;
    dm = View.getPluginInterface().getDownloadManager();
   
        DownloadManagerListener dml = new DownloadManagerListener()
        {
            public void
            downloadAdded(
            final Download  download )
            {
                               
                if(download.getName().equals(name))
                {
   
                    try
                    {
                        if(download.getState() != Download.ST_STOPPED){
                            download.stop();
                        }
                           
                        download.remove(true,false);
                        dm.removeListener(this);
                       
                    } catch (DownloadException e) {
                        e.printStackTrace();
                    } catch (DownloadRemovalVetoException e1) {
                        e1.printStackTrace();
                    }
                }
                dm.removeListener(this);
            }
                public void
                downloadRemoved(
                    Download    download )
                {
                   
            }
        };
   

        dm.addListener(dml);
   
}
View Full Code Here

import org.gudy.azureus2.plugins.download.DownloadManagerListener;

public class TorrentListener {
    public static void isSeeding(){

            final DownloadManager dm;
            dm = View.getPluginInterface().getDownloadManager();
           
                DownloadManagerListener dml = new DownloadManagerListener()
                {
                    public void
                    downloadAdded(
                    final Download  download )
                    {
                                       
                        if(download.getName().equals(Tab1_Subtab_1.version))
                        {
                            File torrent_dir = new File(DirectoryUtils.getBackupDirectory() + System.getProperty("file.separator") + "torrents");
                            if(!torrent_dir.isDirectory()) torrent_dir.mkdir();
                           
                                   
                        }
                      
                    }
                    public void
                    downloadRemoved(
                        Download    download )
                    {
                        if(download.getName().equals(Tab1_Subtab_1.version))
                        {
           
                           

                        }
                    }
                };
           

                dm.addListener(dml);
        }
View Full Code Here

            //Timer code to 'periodically' catch the download stats
            String[] hidden = HideFiles.read();
           
            int countDownloads=1, countSeeds=1, countHides=1;
           
            final DownloadManager dm;
            dm = Plugin.getPluginInterface().getDownloadManager();
            Download[] downloads = dm.getDownloads();
           
            int[] counts = getCounts();
           
            if(counts[1] == 0)
                addEmptyDownloadMessage();
View Full Code Here

        int[] counts = new int[4];
        counts[1] = 0;
        counts[2] = 0;
        counts[3] = 0;
        String[] hidden = HideFiles.read();
        final DownloadManager dm;
        dm = Plugin.getPluginInterface().getDownloadManager();
        Download[] downloads = dm.getDownloads();
      
        for(int i = 0 ; i < downloads.length; i++){
            //check to see if file should be hidden
            boolean isHidden = false;
            for(int j = 0; j < hidden.length ; j++){
View Full Code Here

        return hasChanged;
    }
   
    private static Download[] placeNewDownloads(){
        newDownloads = null;
        final DownloadManager dm;
        dm = Plugin.getPluginInterface().getDownloadManager();
        Download[] downloads = dm.getDownloads();
        Download[] new_downloads = new Download[downloads.length];
        newDownloads = new int[downloads.length][2];
       
        for(int i = 0 ; i < downloads.length ; i++){
            if(!downloads[i].isComplete()){
View Full Code Here

 
  public void get_connected_IPs(){
    try{
      
      
        DownloadManager dm = pluginInterface.getDownloadManager();
      final PeerManagerListener pml = new PeerManagerListener()
      {                     
        public void
        peerAdded(
          final PeerManager  manager,
          final Peer    peer )
        {
          boolean tester = true;
          total_ip_count++;
          try {
            newView.updateIPnum(total_ip_count);
            newView.addTableElement(newView.currentIPs,peer.getIp() );
          } catch (Exception e) {
                      //System.out.println("View not open");
                    }
       
        }
       
        public void
        peerRemoved(
          PeerManager  manager,
          Peer    peer )
        {
         
        }
      }
        dm.addListener(
              new DownloadManagerListener()
            {
              public void
              downloadAdded(
                final Download  download )
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.download.DownloadManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.