1 16 package net.sf.jftp.net; 17 18 import java.util.Enumeration ; 19 import java.util.Hashtable ; 20 21 22 27 public class ConnectionHandler 28 { 29 private Hashtable connections = new Hashtable (); 31 32 public void addConnection(String file, Transfer t) 33 { 34 connections.put(file, t); 35 } 36 37 public void removeConnection(String file) 38 { 39 connections.remove(file); 40 } 41 42 public Hashtable getConnections() 43 { 44 return connections; 45 } 46 47 public int getConnectionSize() 48 { 49 int size = 0; 50 Enumeration e = connections.elements(); 51 52 while(e.hasMoreElements()) 53 { 54 Transfer t = (Transfer) e.nextElement(); 55 56 if(t.hasStarted()) 57 { 58 size++; 59 } 60 } 61 62 return size; 63 } 64 } 65 | Popular Tags |