Class ArtifactTypeUtil


  • public final class ArtifactTypeUtil
    extends Object
    Author:
    eric.wittmann@gmail.com
    • Method Detail

      • discoverType

        public static ArtifactType discoverType​(ContentHandle content,
                                                String contentType)
                                         throws InvalidArtifactTypeException
        Method that discovers the artifact type from the raw content of an artifact. This will attempt to parse the content (with the optional provided Content Type as a hint) and figure out what type of artifact it is. Examples include Avro, Protobuf, OpenAPI, etc. Most of the supported artifact types are JSON formatted. So in these cases we will need to look for some sort of type-specific marker in the content of the artifact. The method does its best to figure out the type, but will default to Avro if all else fails.
        Parameters:
        content -
        contentType -
        Throws:
        InvalidArtifactTypeException