|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javazoom.download.DownloadImpl
This class is the core of Download4J.
It instanciates the Debug object for traces.
It instanciates the Config object matching to XML configuration file.
It reads mime-types from XML file.
It checks data availability
It checks for WWW authentication
It checks for download hits limit
It sets the returning Content-Type
It runs the download in the incoming thread
It counts download hits
It runs as a singleton
Field Summary | |
static int |
DATABASE
|
static java.lang.String |
DEFAULTCONTENTDISPOSITION
Default content-disposition : "" |
static java.lang.String |
DEFAULTCONTENTTYPE
Default content-type for unknown extensions : application/unknown |
static int |
FOLDER
|
static java.lang.String |
LOGFILEDATEFORMAT
Default log file date format : -yyyy-MM-dd_HH-mm |
static java.lang.String |
LOGFILEEXTENSION
Default log file extension : .log |
static java.lang.String |
LOGFILENAME
Default log file prefix : download4j |
static java.lang.String |
REALM
HTTP Realm name for Download4J, Default is Download4J Realm |
static int |
UNKNOWN
|
static int |
ZIP
|
static java.lang.String |
ZIPCONTENTTYPE
Default content-type for zip files : application/zip |
Constructor Summary | |
DownloadImpl(java.lang.String configpath,
java.lang.String xmlconfig,
DownloadListener listener)
Constructs and initializes Download4J. |
Method Summary | |
int |
checkAuth(java.lang.String base64auth,
FileInfo fi)
Checks WWW authentication for FileInfo. |
int |
checkAuth(java.lang.String base64auth,
java.lang.String login,
java.lang.String password)
Checks WWW authentication for input login/password. |
void |
download(FileInfo fi,
java.io.OutputStream out)
Downloads file (in the incoming thread) and sends binary data to user's outputstream. |
int |
getDataLength(FileInfo fi)
Checks if data available are for download. |
void |
process(java.lang.String filename,
java.util.Properties HttpProps,
javax.servlet.http.HttpServletResponse response)
Runs download in the incoming thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String REALM
public static java.lang.String DEFAULTCONTENTTYPE
public static java.lang.String ZIPCONTENTTYPE
public static java.lang.String DEFAULTCONTENTDISPOSITION
public static java.lang.String LOGFILENAME
public static java.lang.String LOGFILEEXTENSION
public static java.lang.String LOGFILEDATEFORMAT
public static int UNKNOWN
public static int FOLDER
public static int ZIP
public static int DATABASE
Constructor Detail |
public DownloadImpl(java.lang.String configpath, java.lang.String xmlconfig, DownloadListener listener) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
configpath
- to xmlconfig filexmlconfig
- file to read and parselistener
- to notify
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
Method Detail |
public void process(java.lang.String filename, java.util.Properties HttpProps, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
filename
- to downloadHttpProps
- Http Properties as login/password, IP addressresponse
- for each end-user
java.io.IOException
public int checkAuth(java.lang.String base64auth, FileInfo fi)
base64auth
- base64 encoded login:passwordfi
- FileInfo
public int checkAuth(java.lang.String base64auth, java.lang.String login, java.lang.String password)
base64auth
- WWW authenticationlogin
- to checkpassword
- to check
public int getDataLength(FileInfo fi)
fi
- FileInfo
public void download(FileInfo fi, java.io.OutputStream out) throws java.io.IOException
fi
- Input FileInfoout
- user's outputstream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |