org.apache.nutch.protocol

## Class Content

- java.lang.Object
- - org.apache.nutch.protocol.Content

- All Implemented Interfaces:
    Writable

      public final class Content
      extends java.lang.Object
      implements Writable

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DIR_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Content()`
    `Content(java.lang.String url, java.lang.String base, byte[] content, java.lang.String contentType, Metadata metadata, Configuration conf)`
    `Content(java.lang.String url, java.lang.String base, byte[] content, java.lang.String contentType, Metadata metadata, MimeUtil mimeTypes)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.String` | `getBaseUrl()` The base url for relative links contained in the content.
    `byte[]` | `getContent()` The binary content retrieved.
    `java.lang.String` | `getContentType()` The media type of the retrieved content.
    `Metadata` | `getMetadata()` Other protocol-specific data.
    `java.lang.String` | `getUrl()` The url fetched.
    `static void` | `main(java.lang.String[] argv)`
    `static Content` | `read(java.io.DataInput in)`
    `void` | `readFields(java.io.DataInput in)`
    `void` | `setContent(byte[] content)`
    `void` | `setContentType(java.lang.String contentType)`
    `void` | `setMetadata(Metadata metadata)` Other protocol-specific data.
    `java.lang.String` | `toString()`
    `void` | `write(java.io.DataOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DIR_NAME

          public static final java.lang.String DIR_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Content

          public Content()

    - #### Content

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

    - #### Content

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

  - ### Method Detail

    - #### readFields

          public final void readFields(java.io.DataInput in)
                                throws java.io.IOException

      Specified by:
        `readFields` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### write

          public final void write(java.io.DataOutput out)
                           throws java.io.IOException

      Specified by:
        `write` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### read

          public static Content read(java.io.DataInput in)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getUrl

          public java.lang.String getUrl()

      The url fetched.

    - #### 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.

    - #### getContent

          public byte[] getContent()

      The binary content retrieved.

    - #### setContent

          public void setContent(byte[] content)

    - #### getContentType

          public java.lang.String getContentType()

      The media type of the retrieved content.
      See Also:
        http://www.iana.org/assignments/media-types/

    - #### setContentType

          public void setContentType(java.lang.String contentType)

    - #### getMetadata

          public Metadata getMetadata()

      Other protocol-specific data.

    - #### setMetadata

          public void setMetadata(Metadata metadata)

      Other protocol-specific data.

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### main

          public static void main(java.lang.String[] argv)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright © 2019 The Apache Software Foundation