Java Doc for Fetcher.java in  » Portal » Open-Portal » com » sun » portal » providers » urlscraper » 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.providers.urlscraper 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.portal.providers.urlscraper.Fetcher

Fetcher
public class Fetcher (Code)

This class fetches and stores the content from an arbitrary url


Inner Class :static class domainPathEntry

Field Summary
final public static  StringKEY_COOKIES_TO_FORWARD_ALL
    
final public static  StringKEY_COOKIES_TO_FORWARD_LIST
    
final public static  StringKEY_FORM_DATA
     The formData as String e.g: login=[uid]&passwd=[password] wher the characters in square bracket are properties available in the channel.
final public static  StringKEY_HTTP_AUTH
    
final public static  StringKEY_HTTP_AUTH_PASSWORD
    
final public static  StringKEY_HTTP_AUTH_UID
    
final public static  StringKEY_INPUT_ENCODING
    
final public static  StringKEY_LOGIN_FORM_DATA
    
final public static  StringKEY_LOGIN_URL
     login URL as string .
final public static  StringKEY_LOGOUT_URL
     logoutUrl as string .
final public static  StringKEY_RESOURCE_BUNDLE
    
final public static  StringKEY_RULESET_ID
    
 intloop
    

Constructor Summary
public  Fetcher(Map config)
    
public  Fetcher(Map configMap, boolean ubt, String ubtAppendUrlSt)
    

Method Summary
 StringBufferfetch(FetcherThread ft, String u)
    

Fetch the contents from the specified URL.

public static  StringgetContentEncoding(String contentType, byte[] bytes, String MIMEType, String profileCharset)
     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.

static  StringgetContentEncodingFromContentBytes(byte[] contentBytes)
    
public  StringBuffergetFilteredContent(int timeOut, HttpServletRequest req, HttpServletResponse res, String urlAsString)
    
public  voidlogout(int timeOut, HttpServletRequest req, HttpServletResponse res)
    
static  byte[]readContent(InputStream in, int contentLength)
    

Field Detail
KEY_COOKIES_TO_FORWARD_ALL
final public static String KEY_COOKIES_TO_FORWARD_ALL(Code)
wether to Forward all Cookies as Boolean



KEY_COOKIES_TO_FORWARD_LIST
final public static String KEY_COOKIES_TO_FORWARD_LIST(Code)
if only selcted Cookies will be forwarded, the list of cookies to be forwarded as List



KEY_FORM_DATA
final public static String KEY_FORM_DATA(Code)
The formData as String e.g: login=[uid]&passwd=[password] wher the characters in square bracket are properties available in the channel.



KEY_HTTP_AUTH
final public static String KEY_HTTP_AUTH(Code)
isHttpAuth , set true only if HttpAuth



KEY_HTTP_AUTH_PASSWORD
final public static String KEY_HTTP_AUTH_PASSWORD(Code)
the password for Http Auth



KEY_HTTP_AUTH_UID
final public static String KEY_HTTP_AUTH_UID(Code)
The Uid for Http Auth



KEY_INPUT_ENCODING
final public static String KEY_INPUT_ENCODING(Code)
The Input encoding as String



KEY_LOGIN_FORM_DATA
final public static String KEY_LOGIN_FORM_DATA(Code)
The form data to be sent to during login if provided e.g: login=[uid]&passwd=[password]



KEY_LOGIN_URL
final public static String KEY_LOGIN_URL(Code)
login URL as string . If this is provided it will be used once to authenticate for the first time



KEY_LOGOUT_URL
final public static String KEY_LOGOUT_URL(Code)
logoutUrl as string . If this is provided it will be used logout



KEY_RESOURCE_BUNDLE
final public static String KEY_RESOURCE_BUNDLE(Code)
As ResourceBundle



KEY_RULESET_ID
final public static String KEY_RULESET_ID(Code)
The RulesetId as String



loop
int loop(Code)
just to store the conetnType, required for ContentFilter




Constructor Detail
Fetcher
public Fetcher(Map config) throws MalformedURLException(Code)

Constructor method
Parameters:
  config - The Map needs lot of entries and the object type as defined.
exception:
  MalformedURLException - The Exception




Fetcher
public Fetcher(Map configMap, boolean ubt, String ubtAppendUrlSt) throws MalformedURLException(Code)

Constructor method
Parameters:
  configMap - the MAP
Parameters:
  ubtAppendUrlSt -
Parameters:
  ubt - Whether to track links outside portal
exception:
  MalformedURLException -





Method Detail
fetch
StringBuffer fetch(FetcherThread ft, String u)(Code)

Fetch the contents from the specified URL. Populates the "content" buffer None
Parameters:
  ft -
Parameters:
  u -




getContentEncoding
public static String getContentEncoding(String contentType, byte[] bytes, String MIMEType, String profileCharset)(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). String charsetor null if charset cannot be determined
Parameters:
  profileCharset -
Parameters:
  contentType - If http(s) urls, null otherwise
Parameters:
  bytes - Bytes from the scraped content
Parameters:
  MIMEType - MIMEType for the content




getContentEncodingFromContentBytes
static 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




getFilteredContent
public StringBuffer getFilteredContent(int timeOut, HttpServletRequest req, HttpServletResponse res, String urlAsString)(Code)
gets the Filtered Content within the timeOut limit else fails
Parameters:
  timeOut -
Parameters:
  req -
Parameters:
  res -
Parameters:
  urlAsString -



logout
public void logout(int timeOut, HttpServletRequest req, HttpServletResponse res)(Code)
Invokes the logout within the timeOut limit else fails
Parameters:
  timeOut -
Parameters:
  req -
Parameters:
  res -



readContent
static byte[] readContent(InputStream in, int contentLength) throws IOException(Code)

Parameters:
  in -
Parameters:
  contentLength -
throws:
  java.io.IOException -



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.