Constructor and Description |
---|
ArtifactFilesystem(ProjectFilesystem filesystem) |
Modifier and Type | Method and Description |
---|---|
void |
copy(Artifact toCopy,
Artifact dest,
CopySourceMode mode)
Makes a copy of the given
Artifact to the given destination Artifact , with copy
behaviour as specified by the CopySourceMode . |
void |
createPackagePaths(com.google.common.collect.ImmutableSet<OutputArtifact> outputs)
Create the package paths that actions will write into if it does not exist
|
InputStream |
getInputStream(Artifact artifact) |
OutputStream |
getOutputStream(Artifact artifact,
FileAttribute<?>... attrs) |
void |
makeExecutable(Artifact artifact)
Make an
Artifact executable |
void |
removeBuildArtifacts(com.google.common.collect.ImmutableSet<OutputArtifact> outputs)
Remove build artifacts (only) that exist on the underlying filesystem.
|
String |
stringify(Artifact artifact)
Expand an artifact into a command line argument.
|
String |
stringifyAbsolute(Artifact artifact)
Expand an artifact into a command line argument.
|
void |
writeContentsToPath(String contents,
Artifact artifact)
Write a string to a given
Artifact , creating parent directories as necessary |
public ArtifactFilesystem(ProjectFilesystem filesystem)
filesystem
- that the Artifact
s are relative to.public InputStream getInputStream(Artifact artifact) throws IOException
artifact
- the artifact to read. It should be bound.InputStream
of the given artifact.IOException
public OutputStream getOutputStream(Artifact artifact, FileAttribute<?>... attrs) throws IOException
artifact
- the artifact to write. It should be bound.OutputStream
of the given artifact.IOException
public void writeContentsToPath(String contents, Artifact artifact) throws IOException
Artifact
, creating parent directories as necessarycontents
- the desired contentsartifact
- the artifact to write. It must be bound.IOException
- The file could not be writtenpublic void makeExecutable(Artifact artifact) throws IOException
Artifact
executableartifact
- the artifact to write. It must be bound.IOException
- Making the file executable failedpublic void copy(Artifact toCopy, Artifact dest, CopySourceMode mode) throws IOException
Artifact
to the given destination Artifact
, with copy
behaviour as specified by the CopySourceMode
.IOException
public String stringify(Artifact artifact)
NOTE: This should not be used just to get a string version of a path. This API may become more restrictive in the future if necessary.
artifact
- a bound artifact whose path is requestedpublic String stringifyAbsolute(Artifact artifact)
NOTE: This should not be used just to get a string version of a path. This API may become
more restrictive in the future if necessary. When possible, then non-absolute version of this
function (stringify(Artifact)
should be used.
artifact
- a bound artifact whose path is requestedpublic void createPackagePaths(com.google.common.collect.ImmutableSet<OutputArtifact> outputs) throws IOException
IOException
public void removeBuildArtifacts(com.google.common.collect.ImmutableSet<OutputArtifact> outputs) throws IOException
IOException