|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.utils.SAX2FilterImpl
org.jasig.portal.utils.AbsoluteURLFilter
public abstract class AbsoluteURLFilter
Replaces all relative URLs with absolute URLs.
Field Summary | |
---|---|
protected java.lang.String |
baseUrl
|
Fields inherited from class org.jasig.portal.utils.SAX2FilterImpl |
---|
contentHandler, dtdHandler, entityResolver, errorHandler, lexicalHandler, locator, log |
Constructor Summary | |
---|---|
protected |
AbsoluteURLFilter(org.xml.sax.ContentHandler handler)
A constructor which receives a ContentHandler to which filtered SAX events are passed |
Method Summary | |
---|---|
protected void |
fixURL(java.lang.String elementName,
java.lang.String attName,
java.lang.String qName,
org.xml.sax.Attributes atts,
org.xml.sax.helpers.AttributesImpl attsImpl)
A helper method for derivitive classes to easily fix an attribute that has a relative URL value |
static AbsoluteURLFilter |
newAbsoluteURLFilter(java.lang.String mimeType,
java.lang.String baseUrl,
org.xml.sax.ContentHandler handler)
A factory method that uses a mime type to decide which kind of AbsoluteURLFilter to instantiate. |
private java.lang.String |
removeUpDirs(java.lang.String url)
Removes the '/../' in the URL. |
protected void |
setBaseUrl(java.lang.String url)
Sets the base URL. |
Methods inherited from class org.jasig.portal.utils.SAX2FilterImpl |
---|
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setAllHandlers, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setParent, setProperty, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String baseUrl
Constructor Detail |
---|
protected AbsoluteURLFilter(org.xml.sax.ContentHandler handler)
handler
- the ContentHandler to which filtered SAX events are passedMethod Detail |
---|
public static final AbsoluteURLFilter newAbsoluteURLFilter(java.lang.String mimeType, java.lang.String baseUrl, org.xml.sax.ContentHandler handler) throws PortalException
mimeType
- the mime type of the markup that this filter will apply tobaseUrl
- the base URL to be prepended to relative URL pathshandler
- the ContentHandler to which to pass along filtered SAX events
PortalException
protected void setBaseUrl(java.lang.String url)
url
- the new base URLprotected final void fixURL(java.lang.String elementName, java.lang.String attName, java.lang.String qName, org.xml.sax.Attributes atts, org.xml.sax.helpers.AttributesImpl attsImpl)
elementName
- the element name containing an attribute of name attNameattName
- the name of the attribute of elementNameqName
- the name of the current elementatts
- the attibutes of the current elementattsImpl
- the attributes implementation to contain the new attribute valueprivate java.lang.String removeUpDirs(java.lang.String url)
url
- the absolute URL generated from the fixURL method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |