SMILA (incubation) API documentation

org.eclipse.smila.connectivity.framework.crawler.web.parse
Class Content

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.crawler.web.parse.Content

public final class Content
extends java.lang.Object

Class that represents the content of the retrieved page.


Constructor Summary
Content()
          Empty constructor.
Content(java.lang.String url, java.lang.String base, byte[] content, java.lang.String contentType)
           
Content(java.lang.String url, java.lang.String base, byte[] content, java.lang.String contentType, Metadata metadata)
          The Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 java.lang.String getBaseUrl()
          The base URL for relative links contained in the content.
 byte[] getContent()
          Returns the binary content retrieved.
 java.lang.String getContentType()
          Returns the media type of the retrieved content.
 Metadata getMetadata()
          Returns other protocol-specific data.
 java.lang.String getUrl()
          The URL fetched.
 int hashCode()
          
 void setContent(byte[] content)
          Assigns the binary content retrieved.
 void setContentType(java.lang.String contentType)
          Assigns the the media type of the retrieved content.
 void setMetadata(Metadata metadata)
          Assigns other protocol-specific data.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Content

public Content()
Empty constructor.


Content

public Content(java.lang.String url,
               java.lang.String base,
               byte[] content,
               java.lang.String contentType)

Content

public Content(java.lang.String url,
               java.lang.String base,
               byte[] content,
               java.lang.String contentType,
               Metadata metadata)
The Constructor.

Parameters:
url - URL
base - Base URL for relative links
content - byte array
contentType - Page Content-type
metadata - Extracted meta data
Method Detail

getUrl

public java.lang.String getUrl()
The URL fetched.

Returns:
String

getBaseUrl

public java.lang.String getBaseUrl()
The base URL for relative links contained in the content. Maybe be different from url if the request redirected.

Returns:
String

getContent

public byte[] getContent()
Returns the binary content retrieved.

Returns:
byte array

setContent

public void setContent(byte[] content)
Assigns the binary content retrieved.

Parameters:
content - byte array

getContentType

public java.lang.String getContentType()
Returns the media type of the retrieved content.

Returns:
String

setContentType

public void setContentType(java.lang.String contentType)
Assigns the the media type of the retrieved content.

Parameters:
contentType - String

getMetadata

public Metadata getMetadata()
Returns other protocol-specific data.

Returns:
Meta data

setMetadata

public void setMetadata(Metadata metadata)
Assigns other protocol-specific data.

Parameters:
metadata - meta data

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

SMILA (incubation) API documentation