diff --git a/src/main/java/cactusServer/utils/JSONConsumer.java b/src/main/java/cactusServer/utils/JSONConsumer.java deleted file mode 100644 index c61d8a2..0000000 --- a/src/main/java/cactusServer/utils/JSONConsumer.java +++ /dev/null @@ -1,46 +0,0 @@ -package cactusServer.utils; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; - -import javax.validation.constraints.Null; -import javax.ws.rs.Consumes; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.Provider; - -import net.arnx.jsonic.JSON; -import net.arnx.jsonic.JSONException; - -/** - * �����g�p���Ȃ��Ȃ�Ǝv�� - * @author student - * - */ -//@Provider -//@Consumes(MediaType.APPLICATION_JSON) -public class JSONConsumer implements MessageBodyReader { - @Override - public boolean isReadable(Class type, java.lang.reflect.Type genericType, - java.lang.annotation.Annotation[] annotations, MediaType mediaType) { - // return true; - return mediaType.isCompatible(MediaType.APPLICATION_JSON_TYPE); - } - - @Override - public Object readFrom(Class type, Type genericType, Annotation[] annotations, MediaType mediaType, - MultivaluedMap httpHeaders, InputStream entityStream) - throws IOException, WebApplicationException { - try { - // return JSON.decode(entityStream,genericType); - return JSON.decode(entityStream, type); - } catch (JSONException e) { - return null; - } - } -} \ No newline at end of file