public interface LoggedArtifactAsset
| Modifier and Type | Method and Description |
|---|---|
ArtifactAsset |
download(Path dir) |
ArtifactAsset |
download(Path dir,
AssetOverwriteStrategy overwriteStrategy) |
ArtifactAsset |
download(Path dir,
Path file,
AssetOverwriteStrategy overwriteStrategy)
Downloads asset to the given directory.
|
String |
getArtifactId()
Returns unique identifier of the artifact.
|
String |
getArtifactVersionId()
Returns the unique identifier of the artifact version.
|
String |
getAssetId()
Returns unique identifier of this asset.
|
String |
getAssetType()
Returns type of this asset.
|
Optional<URI> |
getLink()
Returns the optional
URI of the asset if this is remote asset. |
String |
getLogicalPath()
Returns the logical path of the asset file.
|
Map<String,Object> |
getMetadata()
Returns metadata assigned to this asset.
|
Optional<Long> |
getSize()
Returns the optional size of the asset.
|
boolean |
isRemote()
Allows checking if this is remote asset.
|
InputStream |
openStream()
Opens a connection to this
LoggedArtifactAsset and returns an InputStream for reading from
this connection. |
void |
writeTo(OutputStream out)
Allows loading of asset bytes from Comet server and write to the provided
OutputStream. |
String getArtifactId()
String getArtifactVersionId()
String getAssetId()
String getAssetType()
String getLogicalPath()
Optional<Long> getSize()
Optional<URI> getLink()
URI of the asset if this is remote asset.URI of the asset if this is remote asset.Map<String,Object> getMetadata()
Map if no metadata was assigned.boolean isRemote()
true if this is remote asset.ArtifactAsset download(Path dir, Path file, AssetOverwriteStrategy overwriteStrategy) throws ArtifactException
dir - the root folder to which to download.file - the path relative to the root. If not provided the asset file name will be used as path
relative to the root directory.overwriteStrategy - overwrite strategy to handle conflicting file names.ArtifactAsset representing downloaded asset file.ArtifactException - if operation failed.ArtifactAsset download(Path dir, AssetOverwriteStrategy overwriteStrategy) throws ArtifactException
ArtifactExceptionArtifactAsset download(Path dir) throws ArtifactException
ArtifactExceptionvoid writeTo(OutputStream out) throws ArtifactException
OutputStream.out - the OutputStream where downloaded asset bytes will be written.ArtifactException - if operation failed.InputStream openStream() throws ArtifactException
LoggedArtifactAsset and returns an InputStream for reading from
this connection.
NOTE: You are responsible to close an InputStream to avoid resource leak.
ArtifactException - if operation failed.Copyright © 2022. All rights reserved.