Package org.ametys.web.url
Class UrlPreviewComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.url.UrlPreviewComponent
- All Implemented Interfaces:
- LogEnabled,- Component,- Contextualizable
Component to parse a HTML page to get its meta for preview
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcontextualize(Context context) Convert an file.ico into a file.pnggetFavicon(String url) Fetch and parse the HTML page at given url to get the favicon urlgetUrlPreview(String url, String lang) Fetch and parse the HTML page at given url to get theUrlPreviewFetch and parse the HTML page at given url for previewMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
ROLEThe avalon role
 
- 
- 
Constructor Details- 
UrlPreviewComponentpublic UrlPreviewComponent()
 
- 
- 
Method Details- 
contextualize- Specified by:
- contextualizein interface- Contextualizable
- Throws:
- ContextException
 
- 
getUrlPreviewFetch and parse the HTML page at given url to get theUrlPreview- Parameters:
- url- the url to parse
- lang- the language
- Returns:
- the UrlPreview
- Throws:
- HttpStatusException- if the HTTP request resulted in a not OK HTTP response.
- IOException- if an error occured while parsing HTML page
 
- 
getFaviconFetch and parse the HTML page at given url to get the favicon url- Parameters:
- url- the url to parse
- Returns:
- the favicon url or null if not found
- Throws:
- HttpStatusException- if the HTTP request resulted in a not OK HTTP response.
- IOException- if an error occured while parsing HTML page
 
- 
convertIcoToPngConvert an file.ico into a file.png- Parameters:
- is- the input stream of the file.ico
- Returns:
- the input stream of the file.png
- Throws:
- IOException- if failed to convert .ico
 
- 
parseUrlFetch and parse the HTML page at given url for preview- Parameters:
- url- the url to parse
- lang- the language
- Returns:
- the page information for preview
 
 
-