Package me.mabra.hellonzb.parser

Examples of me.mabra.hellonzb.parser.DownloadFile


    {
      if(!empty)
      {
        // test segment availability mode, channel already authenticated and waiting
        handler = null;
        DownloadFile dl = null;
        synchronized(this.newTasks)
        {
          handler = newTasks.firstElement().handler;
          dl = newTasks.firstElement().dl;
          newTasks.remove(0);
        }
       
        ncMgr.setRspHandler(channel, handler);
        ncMgr.setDLFile(channel, dl);
        ncMgr.setDLFileSeg(channel, dl.getAllOriginalSegments());
        ncMgr.setNCStatus(channel, ChannelStatus.START_FETCH);
      }
    }
    else
    {
View Full Code Here


          updThreadView(channel, msg);
        }
      }
      else
      {
        DownloadFile dl = ncMgr.getDLFile(channel);
        String group = "GROUP " + dl.getGroups().firstElement() + "\r\n";
        string = group;
      }
    }
     
    printDebugMsg("> " + string, channel);
View Full Code Here

  public void fileDownloadFinished(String filename)
  {
    // update total progress bar in the nzb file queue table, also the application window title
    synchronized(filesToDownloadTabModel)
    {
      DownloadFile file = filesToDownloadTabModel.getDownloadFile(filename);
      if(file != null)
        totalBytesLoaded += file.getTotalFileSize();
      else
        return;
    }
    currentNzbParser.setDownloadedBytes(totalBytesLoaded);
    int p = (int) (totalBytesLoaded * 100 / currentNzbParser.getOrigTotalSize());
View Full Code Here

    boolean emptyDownloadFileQueue = false;
    synchronized(filesToDownloadTabModel)
    {
      for(int i = 0; i < filesToDownloadTabModel.getRowCount(); i++)
      {
        DownloadFile file = filesToDownloadTabModel.getDownloadFile(i);

        // check if an error occurred during file download
        // remove line from table if no error occurred
        if(file.getFilename().equals(filename) && !file.downloadError())
        {
          // start running RAR extractor
          if(!currentNzbParser.hasUnrarStarted())
            taskMgr.startRunningRarExtract(currentNzbParser, filename);
          else
View Full Code Here

      disposeRightPopup();

      List<String> toRemove = new ArrayList<>();
      for(int i = 0; i < filesToDownloadTabModel.getRowCount(); i++)
      {
        DownloadFile file = filesToDownloadTabModel.getDownloadFile(i);
        if(!file.getFilename().toLowerCase().endsWith(".par2"))
          continue;

        String prefix = HelloNzbToolkit.getRarFilePrefix(currentNzbParser.getSucceededFirstRarFile());
        if(prefix != null && !file.getFilename().startsWith(prefix))
          continue;

        if(!currentFileDownloader.isActivelyDownloaded(file.getFilename()))
          toRemove.add(file.getFilename());
        else
          currentNzbParser.saveToDelete(file.getFilename());
      }

      for(String f : toRemove)
      {
        logger.msg("Removing inactive file from download queue: " + f, MyLogger.SEV_DEBUG);
View Full Code Here

          logger.msg(msg, MyLogger.SEV_WARNING);
          shutdown = true;
        }

        // update downloaded byte counter ...
        DownloadFile dlFile = handler.dlFileSeg().getDlFile();
        String filename = dlFile.getFilename();
        int bytes = 0;
        Integer bytesInt = downloadedBytes.get(filename);
        if(bytesInt != null)
          bytes = bytesInt;
        bytes += handler.newByteCount();
        downloadedBytes.put(filename, bytes);

        // ... and progres bar in main window
        int last = 0;
        Integer lastInt = lastProgBarUpdate.get(filename);
        if(lastInt != null)
          last = lastInt;
        last = updateProgressBar(bytes, last, dlFile);
        lastProgBarUpdate.put(filename, last);

        // all data downloaded?
        if(handler.isFinished())
        {
          if(handler.getError() == RspHandler.ERR_NONE)
            fetch430count = 0;

          toRemoveVector.add(handler);
          runningThreads--;
          decrSegCount(filename); // decrease main window segment counter

          // segment done, so check if whole download file is finished now
          dlFile.removeSegment(handler.dlFileSeg().getIndex());
          if(!dlFile.hasMoreSegments())
          {
            try
            {
              handleFinishedDlFile(dlFile);
            }
View Full Code Here

    synchronized void removeSegments(String filename)
    {
      ArrayList<DownloadFileSegment> toRemove = new ArrayList<>();
      for(DownloadFileSegment seg : queue)
      {
        DownloadFile dlFile = seg.getDlFile();
        if(dlFile.getFilename().equals(filename))
          toRemove.add(seg);
      }

      queue.removeAll(toRemove);
    }
View Full Code Here

TOP

Related Classes of me.mabra.hellonzb.parser.DownloadFile

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.