public class StandardGeneratedResource extends GeneratedResource
GeneratedResource
.EmittedArtifact.Visibility
Constructor and Description |
---|
StandardGeneratedResource(String partialPath,
byte[] data)
Creates an artifact by writing bytes to the disk cache.
|
StandardGeneratedResource(String partialPath,
long token)
Creates an artifact that points to a file already saved in the disk cache.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getContents(TreeLogger logger)
Provides access to the contents of the EmittedResource.
|
long |
getLastModified()
Returns the time, measured in milliseconds from the epoch, at which the
Artifact was last modified.
|
void |
writeTo(TreeLogger logger,
OutputStream out)
Provides access to the contents of the EmittedResource.
|
compareToComparableArtifact, getComparableArtifactType, getPartialPath, getVisibility, hashCode, isPrivate, setPrivate, setVisibility, toString
compareTo, equals, getLinker, isTransferableFromShards
public StandardGeneratedResource(String partialPath, byte[] data)
public StandardGeneratedResource(String partialPath, long token)
public InputStream getContents(TreeLogger logger) throws UnableToCompleteException
EmittedArtifact
getContents
in class EmittedArtifact
UnableToCompleteException
public long getLastModified()
EmittedArtifact
The default implementation always returns the current time. Subclasses should override this method to provide a type-appropriate value.
getLastModified
in class EmittedArtifact
public void writeTo(TreeLogger logger, OutputStream out) throws UnableToCompleteException
EmittedArtifact
writeTo
in class EmittedArtifact
UnableToCompleteException
Copyright © 2016. All rights reserved.