Package getFilePkg.net.applicationprotocol.http

Examples of getFilePkg.net.applicationprotocol.http.ApplicationProtocol


  private void download() throws IOException, Exception{
    switch(this.task){
    case Task.NewDownload:{
      ConnectionItem nextConnection=new ConnectionItem(filename,
          startByte,endByte);
      ApplicationProtocol appProto=null;
      switch(downloadManager.protocol){
      case Protocol.HTTP:{
        appProto=new HTTPHandler();
        break;
      }
      }
      nextConnection.setConnectionStatus(DownloadStatus.Downloading);
      //nextConnection.connectionThread=this;
      downloadManager.connectionList.add(nextConnection);
      storeObject();
      appProto.connect(downloadManager.host);
      appProto.get(downloadManager.url, filename,startByte,endByte);
      nextConnection.setConnectionStatus(DownloadStatus.Downloaded);
      break;
    }
    case Task.Resume:{
      ApplicationProtocol appProto=null;
      switch(downloadManager.protocol){
      case Protocol.HTTP:{
        appProto=new HTTPHandler();
        break;
      }
      }
      if(connectionItem.getConnectionStatus()==DownloadStatus.Downloading){
        //downloadManager.connectionList.add(connectionItem);
        appProto.connect(downloadManager.host);
        appProto.get(downloadManager.url, filename,startByte,endByte);
        connectionItem.setConnectionStatus(DownloadStatus.Downloaded);
      }
      break;
    }
  }
View Full Code Here

TOP

Related Classes of getFilePkg.net.applicationprotocol.http.ApplicationProtocol

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.