| |
|
| java.lang.Object net.matuschek.http.AbstractHttpDocManager net.matuschek.http.HttpDocToFile
HttpDocToFile | public class HttpDocToFile extends AbstractHttpDocManager (Code) | | DocumentManager that will store document contents in a file.
author: Daniel Matuschek version: $Revision: 1.11 $ |
HttpDocToFile | public HttpDocToFile(String baseDir)(Code) | | creates a new HttpDocToFile object that will store the
documents in the given directory
|
createDirs | protected void createDirs(String filename) throws IOException(Code) | | creates all directories that are needed to place the
file filename if they don't exists
Parameters: filename - the full path name of a file |
getBaseDir | public String getBaseDir()(Code) | | gets the value of baseDir
the value of baseDir |
getCacheFile | protected File getCacheFile(URL url)(Code) | | Gets the cacheFile of the given URL if its document was stored.
Parameters: url - cacheFile |
getExtension | protected String getExtension(URL url)(Code) | | Gets the extension of the given URL if its document was stored.
Parameters: url - String |
getMinFileSize | public int getMinFileSize()(Code) | | gets the value of minFileSize. Files smaller then this size
(in Bytes) will not be saved to disk !
the value of minFileSize |
getStoreCGI | public boolean getStoreCGI()(Code) | | Get the value of storeCGI
If this is true, the object will store ALL retrieved documents,
otherwise it will store only documents from URLs that do not
have a "?" in the URL
|
isReplaceAllSpecials | public boolean isReplaceAllSpecials()(Code) | | Get the value of replaceAllSpecials.
if replaceAllSpecials is true, all sepcial characters in the URL
will be replaced by "-". This is useful for operating system that
can't handle files with special characters in the filename (e.g.
Windows)
value of replaceAllSpecials. |
removeDocument | public void removeDocument(URL u)(Code) | | Removes a document that was stored previous from the file system. Because
the HttpDocToFile does not store the HTTP headers, only the Content-Type
header will exists. Even this header may not be correct. It will only use a
simple heuristic to determine the possible MIME type.
|
retrieveFromCache | public HttpDoc retrieveFromCache(URL u)(Code) | | Gets a document that was stored previous from the file system.
Because the HttpDocToFile does not store the HTTP headers, only
the Content-Type header will exists. Even this header may not
be correct. It will only use a simple heuristic to determine the
possible MIME type.
null, if this document was not stored before or it seemsto be a dynamic document. |
setBaseDir | public void setBaseDir(String baseDir)(Code) | | sets the value of basedir
Parameters: baseDir - the new value of baseDir |
setMinFileSize | public void setMinFileSize(int minFileSize)(Code) | | sets the value of minFileSize
Parameters: minFileSize - the new value of minFileSize See Also: HttpDocToFile.getMinFileSize() |
setReplaceAllSpecials | public void setReplaceAllSpecials(boolean v)(Code) | | Set the value of replaceAllSpecials.
if replaceAllSpecials is true, all sepcial characters in the URL
will be replaced by "-". This is useful for operating system that
can't handle files with special characters in the filename (e.g.
Windows)
Parameters: v - Value to assign to replaceAllSpecials. |
setStoreCGI | public void setStoreCGI(boolean v)(Code) | | Set the value of storeCGI.
If this is true, the object will store ALL retrieved documents,
otherwise it will store only documents from URLs that do not
have a "?" in the URL
Parameters: v - Value to assign to storeCGI. |
storeDocument | public void storeDocument(HttpDoc doc) throws DocManagerException(Code) | | store document (that means write it to disk)
Parameters: doc - the document to store exception: DocManagerException - if the document can't be stored(some IO error occured) |
url2Filename | protected String url2Filename(URL u)(Code) | | converts an URL to a filename http://host/path will
be converted to basedir/host/path
Parameters: URL - a URL to convert, must not be null a pathname |
|
|
|