Class AbstractArtifactStorage

java.lang.Object
org.eclipse.hawkbit.artifact.AbstractArtifactStorage
All Implemented Interfaces:
ArtifactStorage

public abstract class AbstractArtifactStorage extends Object implements ArtifactStorage
Abstract utility class for ArtifactRepository implementations with common functionality, e.g. computation of hashes.
  • 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: ArtifactStorage
      Stores an artifact into the repository.
      Specified by:
      store in interface ArtifactStorage
      Parameters:
      tenant - the tenant to store the artifact
      content - the content to store
      filename - the filename of the artifact
      contentType - the content type of the artifact
      providedHashes - the hashes of the artifact to do hash-checks after storing the artifact, might be null
      Returns:
      the stored artifact
    • sanitizeTenant

      protected static String sanitizeTenant(String tenant)
    • deleteTempFile

      protected void deleteTempFile(File tempFile)
    • storeTempFile

      protected File storeTempFile(InputStream content) throws IOException
      Throws:
      IOException
    • store

      protected abstract void store(String tenant, ArtifactHashes base16Hashes, String contentType, File tempFile) throws IOException
      Throws:
      IOException
    • createTempFile

      public static File createTempFile(boolean directory)