@@ -0,0 +1,2185 @@
+package org.smartdeveloperhub.harvesters.it.backend.exhibitor;%0A%0Aimport com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;%0A%0Aimport org.apache.commons.codec.Charsets;%0Aimport org.apache.commons.io.IOUtils;%0Aimport org.smartdeveloperhub.harvesters.it.backend.Entities;%0Aimport org.smartdeveloperhub.harvesters.it.backend.Entity;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Type;%0A%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.WebApplicationException;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.MultivaluedMap;%0A%0A@Produces(%22application/psr.sdh.itcollector.entity+json%22)%0Apublic class ITHarvesterEntityProvider%3CT%3E extends AbstractMessageReaderWriterProvider%3CT%3E %7B%0A%0A%09private static final String MEDIA_TYPE = %22application/psr.sdh.itcollector.entity+json%22;%0A%0A%09@Override%0A%09public boolean isReadable(Class%3C?%3E type%09, Type genericType,%0A%09%09%09%09%09%09%09%09Annotation%5B%5D annotations, MediaType mediaType) %7B%0A%0A%09%09return true;%0A%09%7D%0A%0A%09@SuppressWarnings(%22unchecked%22)%0A%09@Override%0A%09public T readFrom(Class%3CT%3E type, Type genericType, Annotation%5B%5D annotations,%0A%09%09%09%09%09%09MediaType mediaType, MultivaluedMap%3CString,%0A%09%09%09%09%09%09String%3E httpHeaders, InputStream entityStream)%0A%09%09%09%09%09%09%09%09throws IOException, WebApplicationException %7B%0A%0A%0A%09%09%09String serialized = IOUtils.toString(entityStream, Charsets.UTF_8);%0A%09%09%09return (T) Entities.unmarshallEntity(serialized, (Class%3CEntity%3E) type);%0A%09%7D%0A%0A%09@Override%0A%09public boolean isWriteable(Class%3C?%3E type, Type genericType,%0A%09%09%09%09%09%09%09%09Annotation%5B%5D annotations, MediaType mediaType) %7B%0A%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public void writeTo(T object, Class%3C?%3E type, Type genericType,%0A%09%09%09%09%09%09Annotation%5B%5D annotations, MediaType mediaType,%0A%09%09%09%09%09%09MultivaluedMap%3CString, Object%3E httpHeaders,%0A%09%09%09%09%09%09OutputStream entityStream)%0A%09%09%09%09%09%09%09%09throws IOException, WebApplicationException %7B%0A%0A%09%09if (Entity.class.isAssignableFrom(object.getClass())) %7B%0A%0A%09%09%09String serialized = Entities.marshallEntity((Entity) object);%0A%09%09%09IOUtils.write(serialized, entityStream, Charsets.UTF_8);%0A%0A%09%09%7D else %7B%0A%0A%09%09%09throw new IOException(object.getClass().getName() + %22 cannot be deserialized as %22 + MEDIA_TYPE);%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add entity provider for IT harvester