org.archive.net
Class DownloadURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by org.archive.net.DownloadURLConnection
Direct Known Subclasses:
Md5URLConnection, RsyncURLConnection

public abstract class DownloadURLConnection
extends java.net.URLConnection

An URL Connection that pre-downloads URL reference before passing back a Stream reference. When closed, it removes the local download file.

Version:
$Date: 2006-08-18 16:13:32 +0000 (Fri, 18 Aug 2006) $, $Revision: 4510 $
Author:
stack

Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
protected DownloadURLConnection(java.net.URL u)
           
 
Method Summary
 void connect()
          Do script copy to local file.
protected  java.lang.String[] getCommand(java.net.URL thisUrl, java.io.File downloadFile)
           
 java.io.File getFile()
           
 java.io.InputStream getInputStream()
           
protected  java.lang.String getScript()
           
protected  void setFile(java.io.File f)
           
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DownloadURLConnection

protected DownloadURLConnection(java.net.URL u)
Method Detail

getScript

protected java.lang.String getScript()

getCommand

protected java.lang.String[] getCommand(java.net.URL thisUrl,
                                        java.io.File downloadFile)

connect

public void connect()
             throws java.io.IOException
Do script copy to local file. File is available via getFile().

Specified by:
connect in class java.net.URLConnection
Throws:
java.io.IOException

getFile

public java.io.File getFile()

setFile

protected void setFile(java.io.File f)

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Throws:
java.io.IOException


Copyright © 2003-2011 Internet Archive. All Rights Reserved.