|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavazoom.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
Constructor Summary | |
DownloadImpl(java.lang.String configpath,
java.lang.String xmlconfig)
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,
Config conf)
Downloads file (in the incoming thread) and sends binary data to user's outputstream. |
int |
getDataLength(FileInfo fi,
Config conf)
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 |
Constructor Detail |
public DownloadImpl(java.lang.String configpath, java.lang.String xmlconfig) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
configpath
- to xmlconfig filexmlconfig
- file to read and parse
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, Config conf)
fi
- FileInfo
public void download(FileInfo fi, java.io.OutputStream out, Config conf) 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 |