Examples of Part


Examples of com.oreilly.servlet.multipart.Part

                    && req.getContentType().toUpperCase().
                    startsWith("MULTIPART/FORM-DATA")) {
                final int size = Integer.parseInt(WebMailServer.
                        getStorage().getConfig("max attach size"));
                final MultipartParser mparser = new MultipartParser(req, size);
                Part p;
                while ((p = mparser.readNextPart()) != null) {
                    if (p.isFile()) {
                        final ByteStore bs = ByteStore.getBinaryFromIS(
                                ((FilePart) p).getInputStream(), size);
                        bs.setName(((FilePart) p).getFileName());
                        bs.setContentType(getStorage().getMimeType(
                                    ((FilePart) p).getFileName()));
                        http_header.setContent(p.getName(), bs);
                        log.info("File name " + bs.getName());
                        log.info("Type      " + bs.getContentType());

                    } else if (p.isParam()) {
                        http_header.setContent(p.getName(),
                                ((ParamPart) p).getStringValue());
                    }

                    // log.info("Parameter "+p.getName());
                }
View Full Code Here

Examples of com.oreilly.servlet.multipart.Part

    try {
      // don't worry about NullPointerExceptions.
      // we'll catch exceptions if any operation fails.
      MultipartParser mpp = new MultipartParser(ureq.getHttpReq(), (int) fileUploadLimit * 1024);
      mpp.setEncoding("UTF-8");
      Part part;
      boolean fileWritten = false;
      while ((part = mpp.readNextPart()) != null) {
        if (part.isFile() && !fileWritten) {
          FilePart fPart = (FilePart) part;
          String type = fPart.getContentType();
          // get file contents
          Tracing.logWarn(type + fPart.getFileName(), this.getClass());
          if (fPart != null && fPart.getFileName() != null && type.startsWith("text") && (type.toLowerCase().endsWith("calendar"))) {
           
            // store the uploaded file by a temporary name
            CalendarManager calManager = CalendarManagerFactory.getInstance().getCalendarManager();
            String calID = ImportCalendarManager.getTempCalendarIDForUpload(ureq);
            File tmpFile = calManager.getCalendarFile(CalendarManager.TYPE_USER, calID);
            fPart.writeTo(tmpFile);
           
            // try to parse the tmp file
            Object calendar = calManager.readCalendar(CalendarManager.TYPE_USER, calID);
            if (calendar != null) {
              fileWritten = true;
            }
           
            //the uploaded calendar file is ok.
            fireEvent(ureq, Event.DONE_EVENT);
          }
        } else if (part.isParam()) {
          ParamPart pPart = (ParamPart) part;
          if (pPart.getName().equals("cancel")) {
            // action cancelled
            fireEvent(ureq, Event.CANCELLED_EVENT);
          }
View Full Code Here

Examples of com.sun.java.swing.plaf.windows.TMSchema.Part

        } else {
            size = new Dimension(6, 6);
            XPStyle xp = XPStyle.getXP();
            if (xp != null) {
                boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
                Part part = vertical ? Part.TP_SEPARATOR : Part.TP_SEPARATORVERT;
                Skin skin = xp.getSkin(c, part);
                size.width = skin.getWidth();
                size.height = skin.getHeight();
            }
View Full Code Here

Examples of com.uwyn.drone.protocol.commands.Part

   
    try
    {
      synchronized (mServer)
      {
        mServer.send(new Part(mName));
      }
    }
    catch (CoreException e)
    {
      throw new LeaveErrorException(this, e);
View Full Code Here

Examples of com.vercer.engine.persist.Path.Part

 
  public static Collection<PrefixPropertySet> prefixPropertySets(Set<Property> properties, Path prefix)
  {
    Collection<PrefixPropertySet> result = new ArrayList<PrefixPropertySet>();
    Property[] array = (Property[]) properties.toArray(new Property[properties.size()]);
    Part part = null;
    int start = 0;
    for (int i = 0; i < array.length; i++)
    {
      Part firstPartAfterPrefix = array[i].getPath().firstPartAfterPrefix(prefix);
      if (part != null && !firstPartAfterPrefix.equals(part))
      {
        // if the first part has changed then add a new set
        PrefixPropertySet ppf = createPrefixSubset(prefix, array, part, start, i);
        result.add(ppf);
        start = i;
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.impl.drivers.webservice.Part

     * @param buffer
     */
    private static void addMessageToBuffer(Message input,
                                           StringBuffer buffer) {
        for (int i = 0; i < input.size(); i++) {
            Part part = input.retrievePart(i);
            buffer.append('<').append(part.getName()).append(">\n");
            buffer.append(part.getValue());
            buffer.append("</").append(part.getName()).append(">\n");
        }
    }
View Full Code Here

Examples of de.willuhn.jameica.gui.Part

  {
    GUI.getView().setTitle(i18n.tr("Lizenzinformationen"));
   
    LicenseControl control = new LicenseControl(this);

    Part libs = control.getLibList();
    libs.paint(getParent());
  }
View Full Code Here

Examples of javax.mail.Part

        {
          Multipart multipart = (Multipart)content;

          for (int j = 0, n = multipart.getCount(); j < n; j++)
          {
            Part part = (Part)multipart.getBodyPart(j);
            String contentType = part.getContentType();
            String disposition = part.getDisposition();

            if (disposition == null)
            {
              if (((contentType.length() >= 10) && (contentType.toLowerCase().substring(0, 10).equals("text/plain")))
                || ((contentType.length() >= 9) && (contentType.toLowerCase().substring(0, 9).equals("text/html"))))
              {
                body = (String) (part.getContent()).toString();
              }
            } // end if (disposition == nul)
          } // end for loop
        }else{
          body = (String) (mesage[i].getContent()).toString();
View Full Code Here

Examples of javax.servlet.http.Part

            throw new RuntimeException("Wrong number of uploaded files. Expected 1 got " + files.size());
        }

        final User user = getUser(request);
        Authorizations authorizations = getAuthorizations(request, user);
        final Part file = files.get(0);
        String workspaceId = getActiveWorkspaceId(request);
        Workspace workspace = this.workspaceRepository.findById(workspaceId, user);

        Vertex entityVertex = graph.getVertex(graphVertexId, authorizations);
        if (entityVertex == null) {
View Full Code Here

Examples of javax.wsdl.Part

    private boolean isUniqueBodyPart(String operationName, Message msg) {
        Map partsMap = msg.getParts();
        Iterator ite = partsMap.values().iterator();
        if (ite.hasNext()) {
            Part part = (Part)ite.next();
            if (part.getElementName() == null) {
                return true;
            }
            String opName = getOperationNameWithSamePart(operationName, part);
            if (opName != null) {
                addErrorMessage("Non unique body parts, operation " + "[ " + opName + " ] "
                                + "and  operation [ " + operationName + "] have the same body block "
                                + part.getElementName());
                return false;
            }
        }
        return true;
    }
View Full Code Here
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.