@Override public String uploadFile(InputStream inputStream) throws SerDesException { return schemaRegistry.uploadFile(inputStream); }
@POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("/files") @ApiOperation(value = "Upload the given file and returns respective identifier.", response = String.class, tags = OPERATION_GROUP_OTHER) @Timed public Response uploadFile(@FormDataParam("file") final InputStream inputStream, @FormDataParam("file") final FormDataContentDisposition contentDispositionHeader) { Response response; try { LOG.info("Received contentDispositionHeader: [{}]", contentDispositionHeader); String uploadedFileId = schemaRegistry.uploadFile(inputStream); response = WSUtils.respondEntity(uploadedFileId, Response.Status.OK); } catch (Exception ex) { LOG.error("Encountered error while uploading file", ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("/files") @ApiOperation(value = "Upload the given file and returns respective identifier.", response = String.class, tags = OPERATION_GROUP_OTHER) @Timed public Response uploadFile(@FormDataParam("file") final InputStream inputStream, @FormDataParam("file") final FormDataContentDisposition contentDispositionHeader) { Response response; try { LOG.info("Received contentDispositionHeader: [{}]", contentDispositionHeader); String uploadedFileId = schemaRegistry.uploadFile(inputStream); response = WSUtils.respondEntity(uploadedFileId, Response.Status.OK); } catch (Exception ex) { LOG.error("Encountered error while uploading file", ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }