Examples of Attachment


Examples of net.mcft.copy.betterstorage.attachment.Attachment

  }
 
  private AxisAlignedBB getAttachmentPointsHighlightBox(EntityPlayer player, TileEntity tileEntity,
                                                        MovingObjectPosition target) {
    Attachments attachments = ((IHasAttachments)tileEntity).getAttachments();
    Attachment attachment = attachments.get(target.subHit);
    if (attachment == null) return null;
    return attachment.getHighlightBox();
  }

Examples of net.sf.redmine_mylyn.api.model.Attachment

 
  @Override
  public void uploadAttachment(int issueId, String fileName, String description, AbstractTaskAttachmentSource source, String comment, IProgressMonitor monitor) throws RedmineStatusException {
    ErrrorCollector errorCollector = new ErrrorCollector();
    try {
      Attachment attachment = new Attachment();
      attachment.setFilename(fileName);
      attachment.setDescription(description);
      attachment.setFilesize(source.getLength());
      attachment.setContentType(source.getContentType());

      apiClient.uploadAttachment(issueId, attachment, source.createInputStream(monitor), comment, errorCollector, monitor);
    } catch (CoreException e) {
      new RedmineStatusException(e.getStatus());
    } catch (RedmineApiErrorException e) {

Examples of net.sourceforge.pebble.domain.Attachment

  /**
   * Tests that a relative URI in an attachment is translated.
   */
  public void testRelativeUriInAttachment() throws Exception {
    blogEntry.setAttachment(new Attachment("./files/someimage.jpg", 1024, "image/jpeg"));
    decorator.decorate(context, blogEntry);
    assertEquals("http://www.yourdomain.com/blog/files/someimage.jpg", blogEntry.getAttachment().getUrl());

    blogEntry.setAttachment(new Attachment("http://www.domain.com/files/someimage.jpg", 1024, "image/jpeg"));
    decorator.decorate(context, blogEntry);
    assertEquals("http://www.domain.com/files/someimage.jpg", blogEntry.getAttachment().getUrl());
  }

Examples of net.sourceforge.stripes.examples.bugzooky.biz.Attachment

    @DefaultHandler
    public Resolution getAttachment() {
        BugManager bm = new BugManager();
        Bug bug = bm.getBug(this.bugId);
        Attachment attachment = bug.getAttachments().get(this.attachmentIndex);

        // Uses a StreamingResolution to send the file contents back to the user.
        // Note the use of the chained .setFilename() method, which causes the
        // browser to [prompt to] save the "file" instead of displaying it in browser
        return new StreamingResolution
                (attachment.getContentType(), new ByteArrayInputStream(attachment.getData()))
                    .setFilename(attachment.getName());
    }

Examples of org.activiti.engine.task.Attachment

  }

  protected void saveAttachment() {
    try {
      // Creation and persistence of attachment is done in editor
      Attachment attachment = currentEditor.getAttachment();

      fireEvent(new SubmitEvent(this, SubmitEvent.SUBMITTED, attachment));

      // Finally, close window
      close();

Examples of org.apache.cxf.jaxrs.ext.multipart.Attachment

        Book jaxb = new Book("jaxb", 1L);
        Book json = new Book("json", 2L);
        InputStream is1 =
            getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/java.jpg");
        List<Attachment> objects = new ArrayList<Attachment>();
        objects.add(new Attachment("theroot", MediaType.APPLICATION_XML, jaxb));
        objects.add(new Attachment("thejson", MediaType.APPLICATION_JSON, json));
        objects.add(new Attachment("theimage", MediaType.APPLICATION_OCTET_STREAM, is1));
        Collection<? extends Attachment> coll = client.postAndGetCollection(objects, Attachment.class);
        List<Attachment> result = new ArrayList<Attachment>(coll);
        Book jaxb2 = readBookFromInputStream(result.get(0).getDataHandler().getInputStream());
        assertEquals("jaxb", jaxb2.getName());
        assertEquals(1L, jaxb2.getId());

Examples of org.apache.cxf.jaxrs.ext.multipart.Attachment

        conduit.getClient().setReceiveTimeout(1000000);
        conduit.getClient().setConnectionTimeout(1000000);
        client.type("multipart/form-data").accept("multipart/form-data");
       
        ContentDisposition cd = new ContentDisposition("attachment;filename=java.jpg");
        Attachment att = new Attachment("image", is1, cd);
       
        MultipartBody body = new MultipartBody(att);
        MultipartBody body2 = client.post(body, MultipartBody.class);
        InputStream is2 = body2.getRootAttachment().getDataHandler().getInputStream();
        byte[] image1 = IOUtils.readBytesFromStream(

Examples of org.apache.cxf.jaxrs.ext.multipart.Attachment

        for (Parameter p : fm) {
            Multipart part = getMultipart(ori, p.getIndex());
            if (part != null) {
                Object partObject = params[p.getIndex()];
                if (partObject != null) {
                    atts.add(new Attachment(part.value(), part.type(), partObject));
                }
            }
        }
        return atts;       
    }

Examples of org.apache.cxf.jaxrs.ext.multipart.Attachment

        List<Attachment> atts = image.getAllAttachments();
        if (atts.size() != 1) {
            throw new WebApplicationException();
        }
        List<Attachment> newAtts = new ArrayList<Attachment>();
        Attachment at = atts.get(0);
        MultivaluedMap<String, String> headers = at.getHeaders();
        if (!"http://host/bar".equals(headers.getFirst("Content-Location"))) {
            throw new WebApplicationException();
        }
        if (!"custom".equals(headers.getFirst("Custom-Header"))) {
            throw new WebApplicationException();
        }
        headers.putSingle("Content-Location", "http://host/location");
        newAtts.add(new Attachment(at.getContentId(), at.getDataHandler(), headers));
       
        return new MultipartBody(newAtts);
    }

Examples of org.apache.cxf.message.Attachment

        Collection<Attachment> attachments = resMsg.getAttachments();
        assertNotNull(attachments);
        assertEquals(1, attachments.size());

        Attachment inAtt = attachments.iterator().next();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        IOUtils.copy(inAtt.getDataHandler().getInputStream(), out);
        out.close();
        assertEquals(37448, out.size());
    }
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.