public class SerializationSupport extends Object
BagDeserializers from a mime type| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
GZIP_TYPES |
static Set<String> |
TAR_TYPES |
static Set<String> |
ZIP_TYPES |
| Modifier and Type | Method and Description |
|---|---|
static BagDeserializer |
deserializerFor(Path serializedBag,
BagProfile profile)
Get a
BagDeserializer for a given content type. |
static BagSerializer |
serializerFor(String contentType,
BagProfile profile)
Get a
BagSerializer for a given content type and BagProfile. |
public static final Set<String> GZIP_TYPES
public static BagDeserializer deserializerFor(Path serializedBag, BagProfile profile)
BagDeserializer for a given content type. Currently supported are:
zip (ZIP_TYPES) - ZipBagDeserializer
tar (TAR_TYPES) - TarBagDeserializer
tar+gz (GZIP_TYPES) - GZipBagDeserializerserializedBag - the Bag (still serialized) to get a BagDeserializer forprofile - the BagProfile to ensure that the content type is allowedBagDeserializerUnsupportedOperationException - if the content type is not supportedRuntimeException - if the BagProfile does not allow serializationpublic static BagSerializer serializerFor(String contentType, BagProfile profile)
BagSerializer for a given content type and BagProfile. It takes both a short form (zip,
tar, gzip) and long form (application/zip, application/tar) version for the content type.contentType - the content type to get a BagSerializer forprofile - the BagProfile used for validating the contentTypeBagSerializerRuntimeException - if the contentType is not supportedCopyright © 2020. All rights reserved.