public final class LoggedArtifactAssetImpl extends Object implements LoggedArtifactAsset
LoggedArtifactAsset.| Modifier and Type | Method and Description |
|---|---|
ArtifactAsset |
download(Path dir) |
ArtifactAsset |
download(Path dir,
AssetOverwriteStrategy overwriteStrategy) |
ArtifactAsset |
download(@NonNull Path dir,
@NonNull Path file,
@NonNull 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.
|
Optional<URI> |
getLink()
Returns the optional
URI of the asset if this is remote asset. |
Map<String,Object> |
getMetadata()
Returns metadata assigned to this asset.
|
Optional<Long> |
getSize()
Returns the optional size of the 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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAssetId, getAssetType, getLogicalPath, isRemotepublic String getArtifactId()
LoggedArtifactAssetgetArtifactId in interface LoggedArtifactAssetpublic String getArtifactVersionId()
LoggedArtifactAssetgetArtifactVersionId in interface LoggedArtifactAssetpublic Optional<Long> getSize()
LoggedArtifactAssetgetSize in interface LoggedArtifactAssetpublic Optional<URI> getLink()
LoggedArtifactAssetURI of the asset if this is remote asset.getLink in interface LoggedArtifactAssetURI of the asset if this is remote asset.public Map<String,Object> getMetadata()
LoggedArtifactAssetgetMetadata in interface LoggedArtifactAssetMap if no metadata was assigned.public ArtifactAsset download(Path dir) throws ArtifactException
download in interface LoggedArtifactAssetArtifactExceptionpublic ArtifactAsset download(Path dir, AssetOverwriteStrategy overwriteStrategy) throws ArtifactException
download in interface LoggedArtifactAssetArtifactExceptionpublic ArtifactAsset download(@NonNull @NonNull Path dir, @NonNull @NonNull Path file, @NonNull @NonNull AssetOverwriteStrategy overwriteStrategy) throws ArtifactException
LoggedArtifactAssetdownload in interface LoggedArtifactAssetdir - 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.public void writeTo(OutputStream out) throws ArtifactException
LoggedArtifactAssetOutputStream.writeTo in interface LoggedArtifactAssetout - the OutputStream where downloaded asset bytes will be written.ArtifactException - if operation failed.public InputStream openStream() throws ArtifactException
LoggedArtifactAssetLoggedArtifactAsset and returns an InputStream for reading from
this connection.
NOTE: You are responsible to close an InputStream to avoid resource leak.
openStream in interface LoggedArtifactAssetArtifactException - if operation failed.Copyright © 2022. All rights reserved.