|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.serialize.ProxyWriter
public class ProxyWriter
This Class allows appending PROXY_REWRITE_PREFIX String in front of all the references to images, javascript files, etc.. that are on a remote location. This allows the browser while portal is running in https assume that these resources are secure resources(are referenced by https rather than http). This is because the resource URI insteadof http://www.abc.com/image.gif will be rewriten as as https://[portal address]/PROXY_REWRITE_PREFIX/www.abc.com/image.gif This class does the proxy rewrite in the following exceptional situations as well: 1. If the return code poting to the image is 3XX (the image refrence, refrences is a mapping to a diffrent location) In this case the final destination iddress n which the image or the resource is located is e and then the rewrite points to this location. 2. If the content of a channel is an include javascript file the file is rewriten to a location on a local virtual host and at the same time the image or other resources references are rewritten.
Field Summary | |
---|---|
private static java.lang.String[] |
_proxiableElements
The list of elemnets which src attribute is rewritten with proxy. |
protected boolean |
_proxying
True if allow rewriting certain elements for proxying. |
private static org.apache.commons.logging.Log |
log
|
private static java.lang.String |
PROXIED_FILES_PATH
|
private static java.lang.String |
PROXIED_FILES_URI
|
private static boolean |
PROXY_ENABLED
|
private static java.lang.String |
PROXY_REWRITE_NO_REDIRECT_DOMAIN
|
private static java.lang.String |
PROXY_REWRITE_PREFIX
|
Constructor Summary | |
---|---|
ProxyWriter()
|
Method Summary | |
---|---|
private static java.lang.String |
capture3XXCodes(java.lang.String value)
Capture 3xx return codes - specifically, if 301/302, then go tp the redirected url - note, this in turn may also be redirected. |
protected static java.lang.String |
considerProxyRewrite(java.lang.String name,
java.lang.String localName,
java.lang.String value)
Examines whther or not the proxying should be done and if so handles differnt situations by delegating the rewrite to other methods n the class. |
private static java.lang.String |
createProxyURL(java.lang.String srcValue)
This method receives an image source URL and modified it to be proxied. |
private static java.lang.String |
extractURL(java.lang.String line)
This method takes a String (line) and parses out the value of src attribute in that string. |
private static java.lang.String |
fileNameGenerator(java.lang.String addr)
This method uses a URI and creates an html file name by simply omiting some characters from the URI. |
private static java.lang.String |
processLine(java.lang.String line)
This method parses a line recursivley and replaces all occurances of image references with a proxied reference. |
private static java.lang.String |
reWrite(java.lang.String scriptUri)
This method rewrites include javascript files and replaces the refrences in these files to images' sources to use proxy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
protected boolean _proxying
private static final java.lang.String[] _proxiableElements
private static boolean PROXY_ENABLED
private static java.lang.String PROXIED_FILES_URI
private static java.lang.String PROXIED_FILES_PATH
private static final java.lang.String PROXY_REWRITE_PREFIX
private static final java.lang.String PROXY_REWRITE_NO_REDIRECT_DOMAIN
Constructor Detail |
---|
public ProxyWriter()
Method Detail |
---|
protected static java.lang.String considerProxyRewrite(java.lang.String name, java.lang.String localName, java.lang.String value)
name
- localName
- value
-
private static java.lang.String capture3XXCodes(java.lang.String value)
value
-
private static java.lang.String reWrite(java.lang.String scriptUri)
scriptUri:
- The string representing the address of script
private static java.lang.String fileNameGenerator(java.lang.String addr)
addr:
- is the address of the fileprivate static java.lang.String processLine(java.lang.String line) throws java.lang.Exception
line
- - is the portion of the line or the whole line to be processed.
java.lang.Exception
private static java.lang.String extractURL(java.lang.String line)
line
- - String
private static java.lang.String createProxyURL(java.lang.String srcValue)
srcValue
- - String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |