Package org.apache.wicket.markup.html.form.upload

Examples of org.apache.wicket.markup.html.form.upload.FileUpload.writeTo()


            if (fileUpload != null) {
              LOG.debug("Size: " + fileUpload.getSize());
              LOG.debug("Name: " + fileUpload.getClientFileName());
              LOG.debug("Type: " + fileUpload.getContentType());
              try {
                fileUpload.writeTo(imageFile1);
              } catch (IOException e) {
                throw new WicketRuntimeException(e);
              }
              // following line is actually only required when doing the modal way
              setResponsePage(CloseModalPage.class);             
View Full Code Here


            if (fileUpload != null) {
              LOG.debug("Size: " + fileUpload.getSize());
              LOG.debug("Name: " + fileUpload.getClientFileName());
              LOG.debug("Type: " + fileUpload.getContentType());
              try {
                fileUpload.writeTo(imageFile2);
              } catch (IOException e) {
                throw new WicketRuntimeException(e);
              }
            }
            setResponsePage(CloseModalPage.class);
View Full Code Here

            if (fileUpload != null) {
              LOG.debug("Size: " + fileUpload.getSize());
              LOG.debug("Name: " + fileUpload.getClientFileName());
              LOG.debug("Type: " + fileUpload.getContentType());
              try {
                fileUpload.writeTo(imageFile2);
              } catch (IOException e) {
                throw new WicketRuntimeException(e);
              }
            }
           
View Full Code Here

                try {
                    File currentEngineerDir = new File(ImageUploadHelper.getTemporaryDirPath());
                    if(!currentEngineerDir.exists()){
                        currentEngineerDir.mkdir();
                    }
                    fileUpload.writeTo(new File(currentEngineerDir, fileName));
                } catch (IOException ex) {
                    log.error("Can't upload attachment: " + ex.getMessage(), ex);
                    ImageUploadContentPanel.this.error("Can't upload attachment");
                    pTarget.addComponent(feedback);
                    return ;
View Full Code Here

          File currentEngineerDir = new File(uploadFolderPath);
          if (!currentEngineerDir.exists())
          {
            currentEngineerDir.mkdir();
          }
          fileUpload.writeTo(new File(currentEngineerDir, fileName));
        }
        catch (Exception ex)
        {
          log.error("Can't upload attachment: " + ex.getMessage(), ex);
          ImageUploadContentPanel.this.error("Can't upload attachment");
View Full Code Here

          File currentEngineerDir = new File(uploadFolderPath);
          if (!currentEngineerDir.exists())
          {
            currentEngineerDir.mkdir();
          }
          fileUpload.writeTo(new File(currentEngineerDir, fileName));
        }
        catch (Exception ex)
        {
          log.error("Can't upload attachment: " + ex.getMessage(), ex);
          ImageUploadContentPanel.this.error("Can't upload attachment");
View Full Code Here

                try {
                    if (!newFile.createNewFile()) {
                        throw new IOException(String.format("Could not create file %s", newFile));
                    }
                    fileUpload.writeTo(newFile);
                    File target = new File(transactionFolder, FileRow.TARGET_FILE_NAME);

                    Properties properties = new Properties();
                    properties.setProperty(FileRow.INPUT_NAME_PROPERTY_KEY, fileUpload.getClientFileName());
                    properties.setProperty(FileRow.SOURCE_FORMAT, sourceFormat.getModelObject().toString());
View Full Code Here

            boolean success = newFile.createNewFile();
            if (!success) {
              logger.warn("Trying ot create a file that already exists: "
                  + newFile);
            }
            upload.writeTo(newFile);
            logger.info("Uploaded PIMS export saved to "
                + upload.getClientFileName());
          } catch (IOException e) {
            throw new IllegalStateException("Unable to write file");
          }
View Full Code Here

                                fileName = upload.getClientFileName();
                                fileType = fileExt(upload.getClientFileName());
                                cleanUserFolder(userName);
                                usrFolder = getTempFolder(userName);
                                String destPath = node.getNodePath();
                                upload.writeTo(new File(usrFolder
                                        + pathSeparator
                                        + upload.getClientFileName()));
                                // File writed in temp folder
                                if (fileType != null && !fileType.equals("")
                                        && fileName != null
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.