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, write
public static final String DIR_NAME
public Content()
public Content(String url, String base, byte[] content, String contentType, Metadata metadata, Configuration conf)
public void ensureInflated()
CompressedWritable
ensureInflated
in class CompressedWritable
protected final void readFieldsCompressed(DataInput in) throws IOException
CompressedWritable
CompressedWritable.readFields(DataInput)
.readFieldsCompressed
in class CompressedWritable
IOException
protected final void writeCompressed(DataOutput out) throws IOException
CompressedWritable
CompressedWritable.write(DataOutput)
.writeCompressed
in class CompressedWritable
IOException
public static Content read(DataInput in) throws IOException
IOException
public 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, 2017, Oracle and/or its affiliates. All rights reserved.