Package com.sun.jersey.core.header

Examples of com.sun.jersey.core.header.ContentDisposition


    public ContentDisposition getContentDisposition() {
        if (cd == null) {
            String scd = headers.getFirst("Content-Disposition");
            if (scd != null) {
                try {
                    cd = new ContentDisposition(scd, false);
                } catch (ParseException ex) {
                    throw new IllegalArgumentException("Error parsing content disposition: " + scd, ex);
                }
            }
        }
View Full Code Here


    String expectedFilename = "bar.txt";

    cut.setName(name);
    cut.setFilename(expectedFilename);

    ContentDisposition actual = cut.buildContentDisposition();

    assertEquals(expectedType, actual.getType());
    assertEquals(expectedFilename, actual.getFileName());
  }
View Full Code Here

    String expectedType = "form-data";
    String expectedFilename = "foo";

    cut.setName(name);

    ContentDisposition actual = cut.buildContentDisposition();

    assertEquals(expectedType, actual.getType());
    assertEquals(expectedFilename, actual.getFileName());
  }
View Full Code Here

                        String jsonMetadata = null;

                        // iterate over the body parts and pick out the "photo" and "metadata" parts
                        for (final BodyPart bodyPart : multiPart.getBodyParts()) {

                            final ContentDisposition contentDisposition = bodyPart.getContentDisposition();
                            if (contentDisposition != null) {
                                final Map<String, String> parameters = contentDisposition.getParameters();
                                if (parameters != null) {
                                    final String name = parameters.get("name");
                                    if ("photo".equals(name)) {
                                        // found the photo part
                                        final BodyPartEntity bodyPartEntity = (BodyPartEntity)bodyPart.getEntity();
View Full Code Here

                        String jsonMetadata = null;

                        // iterate over the body parts and pick out the "photo" and "metadata" parts
                        for (final BodyPart bodyPart : multiPart.getBodyParts()) {

                            final ContentDisposition contentDisposition = bodyPart.getContentDisposition();
                            if (contentDisposition != null) {
                                final Map<String, String> parameters = contentDisposition.getParameters();
                                if (parameters != null) {
                                    final String name = parameters.get("name");
                                    if ("photo".equals(name)) {
                                        // found the photo part
                                        final BodyPartEntity bodyPartEntity = (BodyPartEntity)bodyPart.getEntity();
View Full Code Here

    public ContentDisposition getContentDisposition() {
        if (cd == null) {
            String scd = headers.getFirst("Content-Disposition");
            if (scd != null) {
                try {
                    cd = new ContentDisposition(scd);
                } catch (ParseException ex) {
                    throw new IllegalArgumentException("Error parsing content disposition: " + scd, ex);
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.sun.jersey.core.header.ContentDisposition

Copyright © 2018 www.massapicom. 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.