Package io.apicurio.registry.util
Class ArtifactTypeUtil
- java.lang.Object
-
- io.apicurio.registry.util.ArtifactTypeUtil
-
public final class ArtifactTypeUtil extends Object
- Author:
- eric.wittmann@gmail.com
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ArtifactType
discoverType(ContentHandle content, String contentType)
Method that discovers the artifact type from the raw content of an artifact.
-
-
-
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
-
-