Class RegistryClient
java.lang.Object
io.jenkins.plugins.jobcacher.oras.RegistryClient
Registry client wrapping the
Registry instance and its configuration.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordConfiguration of the registry. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new registry client.RegistryClient(String registryUrl, String namespace, com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials credentials) Create a new registry client. -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete an artifact from the registry.voidUpload an artifact to the registry.booleanCheck if an artifact exists in the registry.Get the configuration of the registry.voidTest connection to the registry but uploading an artifact and deleting it.voidUpload an artifact to the registry.
-
Field Details
-
ARTIFACT_MEDIA_TYPE
public static final land.oras.ArtifactType ARTIFACT_MEDIA_TYPE -
CONFIG_MEDIA_TYPE
- See Also:
-
CONTENT_MEDIA_TYPE
- See Also:
-
-
Constructor Details
-
RegistryClient
public RegistryClient(@NonNull String registryUrl, @NonNull String namespace, @NonNull com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials credentials) Create a new registry client.- Parameters:
registryUrl- The URL of the registrynamespace- The namespace to usecredentials- The credentials to use
-
RegistryClient
Create a new registry client.- Parameters:
config- The configuration to use
-
-
Method Details
-
getConfig
Get the configuration of the registry.- Returns:
- The configuration
-
exists
Check if an artifact exists in the registry.- Parameters:
fullName- The full name of the artifactpath- The path of the artifact- Returns:
trueif the artifact exists,falseotherwise
-
delete
Delete an artifact from the registry.- Parameters:
path- The path of the artifact
-
download
Upload an artifact to the registry.- Parameters:
fullName- The full name of the artifactpath- The path of the artifacttarget- The path of the artifact to upload- Throws:
Exception- If an error occurs
-
upload
Upload an artifact to the registry.- Parameters:
fullName- The full name of the artifactpath- The path of the artifactsource- The path of the artifact to upload- Throws:
Exception- If an error occurs
-
testConnection
Test connection to the registry but uploading an artifact and deleting it.- Throws:
Exception
-