|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.japtproxy.misc.IOHandler
public class IOHandler
The IOHandler utility class is responsible for the IO operation between fetchers and pools.
| Field Summary | |
|---|---|
protected FetcherFactory |
fetcherFactory
The FetcherFactory instance. |
| Constructor Summary | |
|---|---|
IOHandler()
|
|
| Method Summary | |
|---|---|
protected int |
copy(java.io.InputStream is,
java.io.OutputStream sendOs,
java.io.OutputStream saveOs)
Copies data from an InputStream to two OutputStreams. |
protected boolean |
isNewVersionCheckRequired(java.lang.String resourceName)
Checks if a new version check is required for a specific resource. |
protected boolean |
isResourceImmutable(java.lang.String resourceName)
Detects if a resource is immutable or not. |
boolean |
sendAndSave(RequestedData requestedData,
PoolObject poolObject,
java.net.URL targetResource,
javax.servlet.http.HttpServletResponse res)
This method is responsible for fetching remote data (if needed) and sending the data (locally stored, or remotely fetched) to the client. |
protected void |
sendLocalFile(PoolObject poolObject,
long requestModifiedSince,
javax.servlet.http.HttpServletResponse res)
Sends a locally stored pool object to the client. |
void |
setFetcherFactory(FetcherFactory fetcherFactory)
|
void |
setImmutableFilePatterns(java.util.regex.Pattern[] immutableFilePatterns)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected FetcherFactory fetcherFactory
| Constructor Detail |
|---|
public IOHandler()
| Method Detail |
|---|
public void setImmutableFilePatterns(java.util.regex.Pattern[] immutableFilePatterns)
public void setFetcherFactory(FetcherFactory fetcherFactory)
protected int copy(java.io.InputStream is,
java.io.OutputStream sendOs,
java.io.OutputStream saveOs)
throws java.io.IOException
is - the InputStream to read fromsendOs - the OutputStream where the data should be sent tosaveOs - the storage OutputStream where the data should be written
java.io.IOException - is thrown if a problem occured while copying dataprotected boolean isResourceImmutable(java.lang.String resourceName)
resourceName - the resource name
protected boolean isNewVersionCheckRequired(java.lang.String resourceName)
resourceName - the resource name to check if a version check is
required for
protected void sendLocalFile(PoolObject poolObject,
long requestModifiedSince,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException
poolObject - the pool object to sentrequestModifiedSince - the "If-Modified-Since" headerres - the HttpServletResponse object
java.io.IOException - is thrown if a problem occured while sending data
public boolean sendAndSave(RequestedData requestedData,
PoolObject poolObject,
java.net.URL targetResource,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException,
ResourceUnavailableException,
InitializationException
requestedData - the requested datapoolObject - the pool objecttargetResource - the remote resource linkres - the HttpServletResponse object
java.io.IOException - is thrown if a problem occured while sending data
ResourceUnavailableException - is thrown if the resource was not
found
InitializationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||