/** * Redirect to original message blob URI * * @param account * @param messageId * @return */ @GET @Path("url") public Response getMessageUrl( @PathParam("user") final String user, @PathParam("domain") final String domain, @PathParam("messageid") final UUID messageId) { Mailbox mailbox = new Mailbox(user, domain); URI uri = null; try { Message message = messageDAO.getParsed(mailbox, messageId); uri = message.getLocation(); Assert.notNull(uri, "No source message"); } catch (IllegalArgumentException iae) { throw new BadRequestException(iae.getMessage()); } catch (Exception e) { logger.warn("Internal Server Error: ", e); throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } return Response.temporaryRedirect(uri).build(); }
@Override public BlobDataSource getRaw(final Mailbox mailbox, final UUID messageId) throws IOException { Message metadata = MessagePersistence.fetch(mailbox.getId(), messageId, false); return blobStorage.read(metadata.getLocation()); }
blobStorage.delete(messages.get(messageId).getLocation());
blobStorage.delete(messages.get(messageId).getLocation());
if (m.getLocation() != null) { columns.put(CN_BRI, m.getLocation().toString());