Java Doc for FileCache.java in  » Portal » Open-Portal » com » sun » portal » portlet » rssportlet » filecache » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.portlet.rssportlet.filecache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
         com.sun.portal.portlet.rssportlet.filecache.FileCache

FileCache
public class FileCache extends HttpServlet (Code)

author:
   Bill York

Inner Class :class FileCacheData

Field Summary
public  HashtablecookieTable
    
protected  booleandebug
    
protected  Propertiesprops
    
protected  HttpServletRequestreq
    
protected  HttpServletResponseres
    
protected static  StringtypeTable
    


Method Summary
public  voiddoGet(HttpServletRequest request, HttpServletResponse response)
    
public  voiddoPost(HttpServletRequest request, HttpServletResponse response)
    
public  booleanforward(String cookieName, boolean allCookies, List cookiesToForwardList)
    

This method returns true if allCookies property is true otherwise checks if the cookie name exists in the cookiesToForward list and returns true if it does or false if it doesn't.

protected  StringgetContentEncoding(String contentType, byte[] bytes, String MIMEType)
     Gets the charset

This method determines the charset based on the contentType header if it is available (only applies to http(s) urls), or from the inputEncoding property if it is non-blank, or from the meta tag in content, e.g.

protected  StringgetContentEncodingFromContentBytes(byte[] contentBytes)
    
protected  FilegetFile(String pathname)
     This method is called by getContent() if the url returned by getURL() is a file url.
protected  StringBuffergetFileAsBuffer(String pathName)
    
protected  FileCacheDatagetFileCache(HttpServletRequest req, HttpServletResponse res, String fileName)
    
protected  StringBuffergetHttpContent(HttpServletRequest req, HttpServletResponse res, String url)
    

Get the provider's content by retrieving content from the specified http or https URL.

public  StringgetInputEncoding()
    

Gets the inputEncoding to be used by content.

protected  StringBuffergetRemoteFile(HttpServletRequest req, HttpServletResponse res, String fileLocation)
    

Gets the file as a string buffer.

protected  StringgetRuleSetID()
    

Gets the urlScraperRulesetID to be used by rewriter.

protected  intgetTimeout()
     Gets the timeout property for the provider.
public  voidinit(ServletConfig servletConf)
    
public  byte[]readContent(InputStream in, int contentLength)
    

Field Detail
cookieTable
public Hashtable cookieTable(Code)
Description of the Field



debug
protected boolean debug(Code)



props
protected Properties props(Code)



req
protected HttpServletRequest req(Code)



res
protected HttpServletResponse res(Code)



typeTable
protected static String typeTable(Code)
Array of File extensions mapped to the MIMETypes





Method Detail
doGet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
doGet just forwards to doPost()
Parameters:
  request - Description of the Parameter
Parameters:
  response - Description of the Parameter
exception:
  ServletException - Description of the Exception
exception:
  IOException - Description of the Exception



doPost
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
Handles the initia lrequest
Parameters:
  request - Description of the Parameter
Parameters:
  response - Description of the Parameter
exception:
  ServletException - Description of the Exception
exception:
  IOException - Description of the Exception



forward
public boolean forward(String cookieName, boolean allCookies, List cookiesToForwardList)(Code)

This method returns true if allCookies property is true otherwise checks if the cookie name exists in the cookiesToForward list and returns true if it does or false if it doesn't.
Parameters:
  allCookies - allCookies property value from display profile
Parameters:
  cookiesToForwardList - cookiesToForwardList property value fromdisplay profile
Parameters:
  cookieName - Description of the Parameter boolean value




getContentEncoding
protected String getContentEncoding(String contentType, byte[] bytes, String MIMEType)(Code)
Gets the charset

This method determines the charset based on the contentType header if it is available (only applies to http(s) urls), or from the inputEncoding property if it is non-blank, or from the meta tag in content, e.g. meta tag in html, xml or wml header if they are available (only applies to HTML, XML, WML).
Parameters:
  contentType - If http(s) urls, null otherwise
Parameters:
  bytes - Bytes from the scraped content
Parameters:
  MIMEType - MIMEType for the content String charset or null if charset cannot be determined
See Also:   com.sun.portal.providers.ProviderException




getContentEncodingFromContentBytes
protected String getContentEncodingFromContentBytes(byte[] contentBytes)(Code)
Gets the charset from content

This method determines the charset based on meta tag in content
Parameters:
  contentBytes - Bytes from the scraped content String charset or null if charset cannot be determined




getFile
protected File getFile(String pathname)(Code)
This method is called by getContent() if the url returned by getURL() is a file url.
Parameters:
  pathname - Description of the Parameter File Object specified by the pathName or null if the filedoes not exists or cannot be read.



getFileAsBuffer
protected StringBuffer getFileAsBuffer(String pathName) throws IOException(Code)
Gets the specified file as StringBuffer
Parameters:
  pathName - Description of the Parameter StringBuffer containing the data from the specifiedfile or null if file does not exist or cannot be read.
exception:
  IOException -
See Also:   com.sun.portal.providers.ProviderException



getFileCache
protected FileCacheData getFileCache(HttpServletRequest req, HttpServletResponse res, String fileName)(Code)
This method will get the file if it exists locally and the disk cache timeout value has not expired
Parameters:
  req - Description of the Parameter
Parameters:
  res - Description of the Parameter
Parameters:
  fileName - Description of the Parameter the contents of the file



getHttpContent
protected StringBuffer getHttpContent(HttpServletRequest req, HttpServletResponse res, String url) throws InterruptedException, MalformedURLException(Code)

Get the provider's content by retrieving content from the specified http or https URL.

This method does not handle file URLs. It only handles http or https urls. The content scraped from the specified url is rewritten if a rewriter is available using the ruleset returned by getRuleSetID()

This method throws exceptions for certain exceptional conditions instead of returning an error message in the returned StringBuffer
Parameters:
  req - An HttpServletRequest that containsinformation related to this request for content.
Parameters:
  res - An HttpServletResponse that allows theprovider to influence the overall response for the desktop page(besides generating the content).
Parameters:
  url - http or https url string Scraped content
exception:
  InterruptedException - if there is a timeout while trying to getthe scraped content
exception:
  MalformedURLException - if the url passed in is not a valid httpor https url.
See Also:   com.sun.portal.providers.ProviderException
See Also:   FileCache.getRuleSetID




getInputEncoding
public String getInputEncoding()(Code)

Gets the inputEncoding to be used by content. This method returns the inputEncoding which would be used in encoding the scraped content. String value
See Also:   com.sun.portal.providers.ProviderException




getRemoteFile
protected StringBuffer getRemoteFile(HttpServletRequest req, HttpServletResponse res, String fileLocation) throws IOException(Code)

Gets the file as a string buffer.

This method calls the getHttpContent method to get the XML file content as a StringBuffer if the XML URL specified is a http or https url.
Parameters:
  fileLocation - Location of the file
Parameters:
  req - Description of the Parameter
Parameters:
  res - Description of the Parameter the file contents as a StringBuffer




getRuleSetID
protected String getRuleSetID()(Code)

Gets the urlScraperRulesetID to be used by rewriter. String value
exception:
  ProviderException - if there is an error getting theurlScrapperRulesetID.
See Also:   com.sun.portal.providers.ProviderException




getTimeout
protected int getTimeout()(Code)
Gets the timeout property for the provider. timeout value
exception:
  ProviderException - if there is an error getting the timeoutproperty.
See Also:   com.sun.portal.providers.ProviderException



init
public void init(ServletConfig servletConf) throws ServletException(Code)
Init is called on servlet startup
Parameters:
  servletConf - Description of the Parameter
exception:
  ServletException - Description of the Exception



readContent
public byte[] readContent(InputStream in, int contentLength) throws IOException(Code)
Description of the Method
Parameters:
  in - Description of the Parameter
Parameters:
  contentLength - Description of the Parameter Description of the Return Value



Methods inherited from javax.servlet.http.HttpServlet
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected long getLastModified(HttpServletRequest req)(Code)(Java Doc)
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)

Methods inherited from javax.servlet.GenericServlet
public void destroy()(Code)(Java Doc)
public String getInitParameter(String name)(Code)(Java Doc)
public Enumeration getInitParameterNames()(Code)(Java Doc)
public ServletConfig getServletConfig()(Code)(Java Doc)
public ServletContext getServletContext()(Code)(Java Doc)
public String getServletInfo()(Code)(Java Doc)
public String getServletName()(Code)(Java Doc)
public void init(ServletConfig config) throws ServletException(Code)(Java Doc)
public void init() throws ServletException(Code)(Java Doc)
public void log(String msg)(Code)(Java Doc)
public void log(String message, Throwable t)(Code)(Java Doc)
abstract public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.