Package org.eclipse.hawkbit.artifact
Class AbstractArtifactStorage
java.lang.Object
org.eclipse.hawkbit.artifact.AbstractArtifactStorage
- All Implemented Interfaces:
ArtifactStorage
Abstract utility class for ArtifactRepository implementations with common functionality, e.g. computation of hashes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilecreateTempFile(boolean directory) protected voiddeleteTempFile(File tempFile) protected static StringsanitizeTenant(String tenant) store(String tenant, InputStream content, String filename, String contentType, ArtifactHashes providedHashes) Stores an artifact into the repository.protected abstract voidstore(String tenant, ArtifactHashes base16Hashes, String contentType, File tempFile) protected FilestoreTempFile(InputStream content) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.hawkbit.artifact.ArtifactStorage
deleteBySha1, deleteByTenant, existsBySha1, getBySha1
-
Constructor Details
-
AbstractArtifactStorage
public AbstractArtifactStorage()
-
-
Method Details
-
store
public StoredArtifactInfo store(String tenant, InputStream content, String filename, String contentType, ArtifactHashes providedHashes) Description copied from interface:ArtifactStorageStores an artifact into the repository.- Specified by:
storein interfaceArtifactStorage- Parameters:
tenant- the tenant to store the artifactcontent- the content to storefilename- the filename of the artifactcontentType- the content type of the artifactprovidedHashes- the hashes of the artifact to do hash-checks after storing the artifact, might benull- Returns:
- the stored artifact
-
sanitizeTenant
-
deleteTempFile
-
storeTempFile
- Throws:
IOException
-
store
protected abstract void store(String tenant, ArtifactHashes base16Hashes, String contentType, File tempFile) throws IOException - Throws:
IOException
-
createTempFile
-