com.github.axet.wget
Class DirectSingle

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

public class DirectSingle
extends Direct


Field Summary
 
Fields inherited from class com.github.axet.wget.Direct
BUF_SIZE, CONNECT_TIMEOUT, READ_TIMEOUT, USER_AGENT
 
Constructor Summary
DirectSingle(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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectSingle

public DirectSingle(DownloadInfo info,
                    File target)
Parameters:
info - download file information
target - target file
stop - multithread stop command
notify - progress notify call
Method Detail

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 single download it will check file dose not exist or zero size. so we can resume download.

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


Copyright © 2012. All Rights Reserved.