com.github.axet.wget
Class DirectRange

java.lang.Object
  extended by com.github.axet.wget.Direct
      extended by com.github.axet.wget.DirectRange

public class DirectRange
extends Direct


Field Summary
 
Fields inherited from class com.github.axet.wget.Direct
BUF_SIZE, CONNECT_TIMEOUT, READ_TIMEOUT, USER_AGENT
 
Constructor Summary
DirectRange(DownloadInfo info, File target)
           
 
Method Summary
static boolean canResume(DownloadInfo info, File targetFile)
          check existing file for download resume.
 void download(AtomicBoolean stop, Runnable notify)
           
 void downloadPart(DownloadInfo info, AtomicBoolean stop, Runnable notify)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectRange

public DirectRange(DownloadInfo info,
                   File target)
Method Detail

downloadPart

public void downloadPart(DownloadInfo info,
                         AtomicBoolean stop,
                         Runnable notify)
                  throws IOException
Throws:
IOException

download

public void download(AtomicBoolean stop,
                     Runnable notify)
Specified by:
download in class Direct

canResume

public static boolean canResume(DownloadInfo info,
                                File targetFile)
check existing file for download resume. for range download it will check file size and inside state. they sould be equal.

Parameters:
info -
targetFile -
Returns:
return true - if all ok, false - if download can not be restored.


Copyright © 2012. All Rights Reserved.