public final class Content extends CompressedWritable
| Constructor and Description |
|---|
Content() |
Content(String url,
String base,
byte[] content,
String contentType,
Metadata metadata,
Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
ensureInflated()
Must be called by all methods which access fields to ensure that the data
has been uncompressed.
|
boolean |
equals(Object o) |
void |
forceInflate()
By calling this method caller forces the next access to any property (via
getters and setters) to check if decompressing of data is really required.
|
String |
getBaseUrl()
The base url for relative links contained in the content.
|
byte[] |
getContent()
The binary content retrieved.
|
String |
getContentType()
The media type of the retrieved content.
|
Metadata |
getMetadata()
Other protocol-specific data.
|
String |
getUrl()
The url fetched.
|
int |
hashCode() |
static Content |
read(DataInput in) |
protected void |
readFieldsCompressed(DataInput in)
Subclasses implement this instead of
CompressedWritable.readFields(DataInput). |
void |
setContent(byte[] content) |
void |
setContentType(String contentType) |
void |
setMetadata(Metadata metadata)
Other protocol-specific data.
|
String |
toString() |
protected void |
writeCompressed(DataOutput out)
Subclasses implement this instead of
CompressedWritable.write(DataOutput). |
readFields, writepublic static final String DIR_NAME
public Content()
public Content(String url, String base, byte[] content, String contentType, Metadata metadata, Configuration conf)
public void ensureInflated()
CompressedWritableensureInflated in class CompressedWritableprotected final void readFieldsCompressed(DataInput in) throws IOException
CompressedWritableCompressedWritable.readFields(DataInput).readFieldsCompressed in class CompressedWritableIOExceptionprotected final void writeCompressed(DataOutput out) throws IOException
CompressedWritableCompressedWritable.write(DataOutput).writeCompressed in class CompressedWritableIOExceptionpublic static Content read(DataInput in) throws IOException
IOExceptionpublic String getUrl()
public String getBaseUrl()
public byte[] getContent()
public void setContent(byte[] content)
public String getContentType()
public void setContentType(String contentType)
public Metadata getMetadata()
public void setMetadata(Metadata metadata)
public void forceInflate()
Copyright © 2007, 2014, Oracle and/or its affiliates. All rights reserved.