Examples of Attachment


Examples of org.apache.cxf.message.Attachment

        }

        public boolean containsValue(Object value) {
            Iterator<Attachment> it = collection.iterator();
            while (it.hasNext()) {
                Attachment at = it.next();
                if (value.equals(at.getDataHandler())) {
                    return true;
                }
            }
            return false;
        }

Examples of org.apache.cxf.message.Attachment

        }

        public DataHandler get(Object key) {
            Iterator<Attachment> it = collection.iterator();
            while (it.hasNext()) {
                Attachment at = it.next();
                if (key.equals(at.getId())) {
                    return at.getDataHandler();
                }
            }
            return null;
        }

Examples of org.apache.cxf.message.Attachment

        }
       
        public DataHandler remove(Object key) {
            Iterator<Attachment> it = collection.iterator();
            while (it.hasNext()) {
                Attachment at = it.next();
                if (key.equals(at.getId())) {
                    collection.remove(at);
                    return at.getDataHandler();
                }
            }
            return null;
        }

Examples of org.apache.cxf.message.Attachment

                }
            }
            return null;
        }
        public DataHandler put(String key, DataHandler value) {
            Attachment at = new AttachmentImpl(key, value);
            collection.add(at);
            return value;
        }

Examples of org.apache.wiki.attachment.Attachment

                m_iterator = atts.iterator();

                if( m_iterator.hasNext() )
                {
                    Attachment  att = (Attachment) m_iterator.next();

                    WikiContext context = (WikiContext)m_wikiContext.clone();
                    context.setPage( att );
                    pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
                                              context,

Examples of org.apache.wiki.attachment.Attachment

            }
        }

        if( m_iterator != null && m_iterator.hasNext() )
        {
            Attachment att = (Attachment) m_iterator.next();

            WikiContext context = (WikiContext)m_wikiContext.clone();
            context.setPage( att );
            pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
                                      context,

Examples of org.apache.wss4j.common.ext.Attachment

        parts.add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/", "Content"));
        parts.add(new WSEncryptionPart("cid:Attachments", "Content"));
        builder.setParts(parts);

        final String attachmentId = UUID.randomUUID().toString();
        final Attachment attachment = new Attachment();
        attachment.setMimeType("text/xml");
        attachment.addHeaders(getHeaders(attachmentId));
        attachment.setId(attachmentId);
        attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes("UTF-8")));

        AttachmentCallbackHandler attachmentCallbackHandler =
            new AttachmentCallbackHandler(Collections.singletonList(attachment));
        builder.setAttachmentCallbackHandler(attachmentCallbackHandler);

        LOG.info("Before Signing....");
        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        WSSecHeader secHeader = new WSSecHeader();
        secHeader.insertSecurityHeader(doc);
        Document signedDoc = builder.build(doc, crypto, secHeader);

        if (LOG.isDebugEnabled()) {
            LOG.debug("After Signing....");
            String outputString = XMLUtils.PrettyDocumentToString(signedDoc);
            LOG.debug(outputString);
        }

        NodeList sigReferences = signedDoc.getElementsByTagNameNS(WSConstants.SIG_NS, "Reference");
        Assert.assertEquals(2, sigReferences.getLength());

        attachmentCallbackHandler =
            new AttachmentCallbackHandler(Collections.singletonList(attachment));
        verify(signedDoc, attachmentCallbackHandler);

        Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
        Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
        byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
        Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes("UTF-8")));
        Assert.assertEquals("text/xml", responseAttachment.getMimeType());
    }

Examples of org.camunda.bpm.engine.task.Attachment

  public void testDeleteAttachmentEvents() {
    // initially there are no task events
    assertTrue(taskService.getTaskEvents(task.getId()).isEmpty());

    identityService.setAuthenticatedUserId(JONNY);
    Attachment attachment = taskService.createAttachment(IMAGE_PNG, task.getId(), null, IMAGE_NAME, IMAGE_DESC, IMAGE_URL);

    ClockUtil.setCurrentTime(new Date(ClockUtil.getCurrentTime().getTime() + 5000));

    taskService.deleteAttachment(attachment.getId());

    // now there is a task event created
    List<Event> events = taskService.getTaskEvents(task.getId());
    assertEquals(2, events.size());
    Event event = events.get(0);

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

    private TestUtils() {}

    public static Attachment createAttachment() {
        try {
        return new Attachment(
            "Test Attachment",
            "text/plain",
            new URL("http://geekseek.org"));
        } catch(MalformedURLException e) {
            throw new RuntimeException(e);

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

    // Story: As a User I should be able to create an Attachment

    @Test
    public void shouldBeAbleToCreateAttachment() throws Exception {
        Attachment attachment = createAttachment();
        repository.store(attachment);

        Attachment stored = repository.get(attachment.getId());
        Assert.assertNotNull(stored);

        Assert.assertEquals(attachment.getId(), stored.getId());
        Assert.assertEquals(attachment.getTitle(), stored.getTitle());
        Assert.assertEquals(attachment.getUrl(), stored.getUrl());
        Assert.assertEquals(attachment.getMimeType(), stored.getMimeType());
        Assert.assertNotNull(stored.getCreated());
    }
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.