| .. | .. |
|---|
| 23 | 23 | import net.curisit.integrity.beans.ServiceResponse; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | import org.apache.commons.io.IOUtils; |
|---|
| 26 | +import org.apache.logging.log4j.LogManager; |
|---|
| 27 | +import org.apache.logging.log4j.Logger; |
|---|
| 26 | 28 | import org.jboss.resteasy.annotations.providers.multipart.MultipartForm; |
|---|
| 27 | 29 | import org.jboss.resteasy.annotations.providers.multipart.PartType; |
|---|
| 28 | | -import org.apache.logging.log4j.Logger; |
|---|
| 29 | | -import org.apache.logging.log4j.LogManager; |
|---|
| 30 | 30 | |
|---|
| 31 | 31 | // The Java class will be hosted at the URI path "/myresource" |
|---|
| 32 | 32 | @Path("/test") |
|---|
| .. | .. |
|---|
| 50 | 50 | * @return the server version in format majorVersion.minorVersion |
|---|
| 51 | 51 | */ |
|---|
| 52 | 52 | @GET |
|---|
| 53 | | - @Produces({ MediaType.TEXT_HTML }) |
|---|
| 53 | + @Produces({ |
|---|
| 54 | + MediaType.TEXT_HTML |
|---|
| 55 | + }) |
|---|
| 54 | 56 | public Response index() { |
|---|
| 55 | 57 | try { |
|---|
| 56 | 58 | String index = IOUtils.toString(this.getClass().getResourceAsStream("/static/index.html")); |
|---|
| .. | .. |
|---|
| 63 | 65 | |
|---|
| 64 | 66 | @GET |
|---|
| 65 | 67 | @Path("/dummy") |
|---|
| 66 | | - @Produces({ MediaType.TEXT_PLAIN }) |
|---|
| 68 | + @Produces({ |
|---|
| 69 | + MediaType.TEXT_PLAIN |
|---|
| 70 | + }) |
|---|
| 67 | 71 | public Response dummy(@Context HttpServletRequest request) { |
|---|
| 68 | 72 | LOG.info("Request: " + request.getPathInfo()); |
|---|
| 69 | 73 | return Response.ok().entity((uri == null)).build(); |
|---|
| .. | .. |
|---|
| 76 | 80 | @POST |
|---|
| 77 | 81 | @Path("/upload1") |
|---|
| 78 | 82 | @Consumes(MediaType.MULTIPART_FORM_DATA) |
|---|
| 79 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 83 | + @Produces({ |
|---|
| 84 | + MediaType.APPLICATION_JSON |
|---|
| 85 | + }) |
|---|
| 80 | 86 | public Response testFile1(@MultipartForm FileUploadForm mfdi) { |
|---|
| 81 | 87 | LOG.info("FORM: texto: {}, file: {}", mfdi.getTexto(), new String(mfdi.getFile())); |
|---|
| 82 | 88 | return Response.ok("OK").build(); |
|---|
| .. | .. |
|---|
| 84 | 90 | |
|---|
| 85 | 91 | @GET |
|---|
| 86 | 92 | @Path("/current/{license}") |
|---|
| 87 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 93 | + @Produces({ |
|---|
| 94 | + MediaType.APPLICATION_JSON |
|---|
| 95 | + }) |
|---|
| 88 | 96 | public ServiceResponse<ServerConfigVersions> testFile(@PathParam("license") String license, |
|---|
| 89 | 97 | @DefaultValue("-1") @QueryParam("minorVersion") int minorVersion, @DefaultValue("-1") @QueryParam("majorVersion") int majorVersion) { |
|---|
| 90 | 98 | |
|---|
| .. | .. |
|---|
| 104 | 112 | @PartType("text/plain") |
|---|
| 105 | 113 | private String texto; |
|---|
| 106 | 114 | |
|---|
| 107 | | - public FileUploadForm() {} |
|---|
| 115 | + public FileUploadForm() { |
|---|
| 116 | + } |
|---|
| 108 | 117 | |
|---|
| 109 | 118 | public byte[] getFile() { |
|---|
| 110 | 119 | return file; |
|---|