Examples of Attachment


Examples of com.softserve.academy.food.entity.Attachment

    public void setName(String name) {
        this.name = name;
    }

    public Attachment toEntity() {
        return new Attachment(this);
    }

Examples of com.sogou.qadev.service.cynthia.bean.Attachment

   * @return
   */
  public static boolean abscut(String fileId, int x, int y,int width, int height) {
    DataAccessSession das = DataAccessFactory.getInstance().getSysDas();
   
    Attachment attachment = das.queryAttachment(DataAccessFactory.getInstance().createUUID(fileId), true);
     
    if (attachment == null)
      return false;
   
        try {
            //读取源图像
            BufferedImage bi = ImageIO.read(new ByteArrayInputStream(attachment.getData()));
            byte[] outByte = abscut(bi, x, y, width, height);
            //更新文件data
            attachment.setData(outByte);
            return das.updateAttachment(attachment);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }finally{

Examples of com.sun.xml.internal.ws.api.message.Attachment

        //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
        Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
        AttachmentSet attSet = packet.getMessage().getAttachments();
        for(String cid : atts.keySet()){
            if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice
                Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
                attSet.add(att);
            }
        }

        try {

Examples of com.sun.xml.ws.api.message.Attachment

            if (event == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI)) {
                //its xop reference, take the URI reference
                String href = reader.getAttributeValue(null, "href");
                try {
                    xopHref = href;
                    Attachment att = getAttachment(href);
                    if(att != null){
                        DataHandler dh = att.asDataHandler();
                        if (dh instanceof StreamingDataHandler) {
                            ((StreamingDataHandler)dh).setHrefCid(att.getContentId());
                        }
                        base64AttData = new Base64Data();
                        base64AttData.set(dh);
                    }
                    xopReferencePresent = true;

Examples of com.taskadapter.redmineapi.bean.Attachment

        assertThat(specificPage.getCreatedOn()).isNotNull();
        assertThat(specificPage.getUpdatedOn()).isNotNull();
        assertThat(specificPage.getAttachments()).isNotNull();
        assertThat(specificPage.getAttachments().size()).isEqualTo(1);

        Attachment attachment = specificPage.getAttachments().get(0);

        assertThat(attachment.getFileName()).isEqualTo("happy_penguin.jpg");
        assertThat(attachment.getId()).isEqualTo(8);
        assertThat(attachment.getFileSize()).isEqualTo(72158);
        assertThat(attachment.getAuthor().getFullName()).isEqualTo("Redmine Admin");
        assertThat(attachment.getContentURL()).isEqualTo("http://76.126.10.142/redmine/attachments/download/8/happy_penguin.jpg");
    }

Examples of de.spotnik.mail.core.message.Attachment

    public void testGetDispostion() throws MessagingException
    {
        assertEquals(Attachment.ATTACHMENT, attachment.getDispostion());
       
        part.setDisposition("inline");
        attachment = new Attachment((BodyPart) part);
        assertEquals("inline", attachment.getDispostion());
       
        part.setDisposition("attachment; filename=\"spotnik.gif\"");
        attachment = new Attachment((BodyPart) part);
        assertEquals(Attachment.ATTACHMENT, attachment.getDispostion());
    }

Examples of eu.semberal.reminders.entity.Attachment

    }

    public Resolution download() {

        if (attachmentId == null) return new ErrorResolution(404);
        Attachment attachment = filesService.getAttachment(attachmentId);
        if (attachment == null || !attachment.getUser().equals(getContext().getUser())) return new ErrorResolution(403);
        File f = filesService.getAttachmentFile(attachmentId);
        if (f == null || attachment == null) return new ErrorResolution(404);

        FileInputStream fileInputStream;
        try {
            fileInputStream = new FileInputStream(f);
        } catch (Exception e) {
            return new ErrorResolution(404);
        }
        return new StreamingResolution(null, fileInputStream).setFilename(attachment.getFilename());
    }

Examples of fr.ippon.tatami.domain.Attachment

            method = RequestMethod.DELETE,
            produces = "application/json")
    @ResponseBody
    @Timed
    public Attachment DeleteAttachment(@PathVariable("attachmentId") String attachmentId) {
        Attachment attachment = attachmentService.getAttachmentById(attachmentId);
        attachmentService.deleteAttachment(attachment);
        return attachment;
    }

Examples of info.jtrac.domain.Attachment

                sb.append("<tr valign='top'" + (row % 2 == 0 ? altStyle : "") + ">");
                sb.append("  <td" + tdStyle + ">" + history.getLoggedBy().getName() + "</td>");
                sb.append("  <td" + tdStyle + ">" + history.getStatusValue() +"</td>");
                sb.append("  <td" + tdStyle + ">" + (history.getAssignedTo() == null ? "" : history.getAssignedTo().getName()) + "</td>");
                sb.append("  <td" + tdStyle + ">");
                Attachment attachment = history.getAttachment();
                if (attachment != null) {
                    if (request != null && response != null) {
                        String href = response.encodeURL(request.getContextPath() + "/app/attachments/" + attachment.getFileName() +"?filePrefix=" + attachment.getFilePrefix());
                        sb.append("<a target='_blank' href='" + href + "'>" + attachment.getFileName() + "</a>&nbsp;");
                    } else {
                        sb.append("(attachment:&nbsp;" + attachment.getFileName() + ")&nbsp;");
                    }
                }
                sb.append(fixWhiteSpace(history.getComment()));
                sb.append("  </td>");
                sb.append("  <td" + tdStyle + ">" + history.getTimeStamp() + "</td>");

Examples of models.Attachment

        if (uploader.isAnonymous()) {
            return forbidden();
        }

        // Attach the file to the user who upload it.
        Attachment attach = new Attachment();
        boolean isCreated = attach.store(file, filePart.getFilename(), uploader.asResource());

        // The request has been fulfilled and resulted in a new resource being
        // created. The newly created resource can be referenced by the URI(s)
        // returned in the entity of the response, with the most specific URI
        // for the resource given by a Location header field.
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.