Examples of FileItem


Examples of com.adito.networkplaces.model.FileItem

                  .getName(), fileSystemForm.getPath(), gc, element.getFile().getType().getName(), false, i);
        } else if (ft != null && element.getFile().getType().equals(FileType.FILE)) {
          // if it is a file
                    if(element.getLastModified() != null)
                        gc.setTime(element.getLastModified());
          item = new FileItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), element.getContentLength()
                  .longValue(), gc, element.getFile().getType().getName(), false, i);
        } else {
          if (log.isInfoEnabled())
            log.info("Unable to display file " + element.getDisplayName() + " as it is an imaginary file.");
          warnings.add(Constants.REQ_ATTR_WARNINGS, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
View Full Code Here

Examples of com.bradmcevoy.http.FileItem

      if (files.isEmpty()) {
        log.warn("No meta file provided");
        throw new BadRequestException(r);
      } else {
        try {
          FileItem item = files.values().iterator().next();

          File metaFile = metaStore.storeMetaData(r, item.getInputStream());

          // copy content to a file
          File tempData = File.createTempFile("milton-zsync", null);
          FileOutputStream fDataOut = new FileOutputStream(tempData);
          r.sendContent(fDataOut, null, null, null);
View Full Code Here

Examples of com.dotcms.repackage.org.apache.commons.fileupload.FileItem

        throw new Exception("Could not upload File. Invalid User");
      }


      for (Iterator i = items.iterator(); i.hasNext();) {
        FileItem fileItem = (FileItem) i.next();

        if (!fileItem.isFormField()) {


          // *************************************************
          // This is where you would process the uploaded file
          // *************************************************

          if(fileItem.getSize() == 0)
            isEmptyFile = true;

          if (fileItem.getName().contains(File.separator)) {
            fileName = fileItem.getName().substring(
                fileItem.getName().lastIndexOf(File.separator) + 1);
          } else {
            fileName = fileItem.getName();
          }
          fileName = ContentletUtil.sanitizeFileName(fileName);

          File tempUserFolder = new File(APILocator.getFileAPI().getRealAssetPathTmpBinary() + File.separator + userId +
              File.separator + fieldName);

          if(!isValidPath(tempUserFolder.getCanonicalPath())) {
            throw new IOException("Invalid fileName or Path");
          }

          if (!tempUserFolder.exists())
            tempUserFolder.mkdirs();
          File dest=new File(tempUserFolder.getAbsolutePath() + File.separator + fileName);
          if(dest.exists())
            dest.delete();
          fileItem.write(dest);
          fileItem.delete();
        }
      }

      if(isEmptyFile)
        fileName = "";
View Full Code Here

Examples of com.elibom.jogger.http.FileItem

            // create the temp file
            File tempFile = createTempFile(multipartReader);

            // call the part handler
            FileItem fileItem = new FileItem(fieldName, fileName, partContentType, tempFile.length(), tempFile, headers);
            partHandler.handleFileItem(fieldName, fileItem);
          }

          continue;
        }
      } else {
        String fileName = getFileName( headers.get(CONTENT_DISPOSITION) );
        String partContentType = headers.get(CONTENT_TYPE);
        if (fileName != null) {

          // create the temp file
          File tempFile = createTempFile(multipartReader);

          // call the part handler
          FileItem fileItem = new FileItem(currentFieldName, fileName, partContentType, tempFile.length(),
              tempFile, headers);
          partHandler.handleFileItem(currentFieldName, fileItem);
          continue;
        }
      }
View Full Code Here

Examples of com.pegaa.uploader.ui.filelist.item.FileItem

    private ListItem createListItem(File f)
    {
         if(this.policy.getPolicyType() == ImageUploadPolicy.POLICY_TYPE_IMG){
             return new ImageItem(this.configHolder, f);
         }else{
             return new FileItem(this.configHolder, f);
         }
    }
View Full Code Here

Examples of com.vaadin.data.util.FilesystemContainer.FileItem

        // Check if event occured at fsTree component
        if (event.getSource() == filesystem) {
            // Check if event is about changing value
            if (event.getClass() == Field.ValueChangeEvent.class) {
                // Update property panel contents
                final FileItem fileItem = (FileItem) filesystem
                        .getItem(filesystem.getValue());
                fileProperties.setIcon(fileItem.getIcon());
                fileProperties.setCaption(fileItem.getName() + ", size "
                        + fileItem.getSize() + " bytes.");
                propertyPanel.setEnabled(true);
            }
            // here we could check for other type of events for filesystem
            // component
        }
View Full Code Here

Examples of net.sf.rej.gui.compare.FileItem

                    int row, boolean hasFocus) {
                // customize color
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
                Object obj = node.getUserObject();
                if (obj instanceof FileItem) {
                  FileItem fileItem = (FileItem) obj;
                  switch (fileItem.getStyle()) {
            case PLAIN:
              this.leafIcon = leafPlain;
              break;             
            case RED:
              this.leafIcon = leafRed;
View Full Code Here

Examples of org.apache.commons.fileupload.FileItem

            ServletFileUpload upload = new ServletFileUpload(factory);
            upload.setSizeMax(-1);
            upload.setHeaderEncoding("UTF8");
            try {
                for (Iterator it = upload.parseRequest(request).iterator(); it.hasNext();) {
                    FileItem fi = (FileItem) it.next();
                    if (!fi.isFormField()) {
                        if (fi.getName() != null && fi.getName().length() > 0) {
                            tmpWar = new File(System.getProperty("java.io.tmpdir"), FilenameUtils.getName(fi.getName()));
                            fi.write(tmpWar);
                        }
                    } else if ("context".equals(fi.getFieldName())) {
                        contextName = fi.getString();
                    } else if ("update".equals(fi.getFieldName()) && "yes".equals(fi.getString())) {
                        update = true;
                    } else if ("compile".equals(fi.getFieldName()) && "yes".equals(fi.getString())) {
                        compile = true;
                    } else if ("discard".equals(fi.getFieldName()) && "yes".equals(fi.getString())) {
                        discard = true;
                    }
                }
            } catch (Exception e) {
                logger.fatal("Could not process file upload", e);
View Full Code Here

Examples of org.apache.commons.fileupload.FileItem

  {
    if(!ServletFileUpload.isMultipartContent(request))
      return;

    // 1. Parsing the form fields...
    FileItem item = null;
    String comment = null;
    FileItem imageFileFormField = null;
    try
    {
      FileItemFactory factory = new DiskFileItemFactory();
      ServletFileUpload upload = new ServletFileUpload(factory);
      List<?> items = upload.parseRequest(request);
View Full Code Here

Examples of org.apache.commons.fileupload.FileItem

        SshSession session = new SshSession( request );
        String connectionInfo = "";
        String channelId = "";
        String fileName = "";
        FileItem file = null;
        String redirectPage = PAGE_HOME;

        try
        {
            // Parse the parts into Parameters and the file.
            List files = upload.parseRequest( request );
            Iterator iter = files.iterator();
            while (iter.hasNext())
            {
                FileItem fileItem = (FileItem) iter.next();
                String fieldName;
                if( fileItem.isFormField() )
                {
                    fieldName = fileItem.getFieldName();
                    if( PARAMETER_CONNECTION.equals( fieldName ) )
                    {
                        connectionInfo = fileItem.getString();
                    }
                    else if( PARAMETER_CHANNEL.equals( fieldName ) )
                    {
                        channelId = fileItem.getString();

                    }
                    else if( PARAMETER_FILENAME.equals( fieldName ) )
                    {
                        fileName = fileItem.getString();
                    }
                }
                else
                {
                    file = fileItem;
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.