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

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


        checkFileExists(newFile);
        try
        {
          // Save to new file
          newFile.createNewFile();
          upload.writeTo(newFile);

          MultiUploadPage.this.info("saved file: " + upload.getClientFileName());
        }
        catch (Exception e)
        {
View Full Code Here


                                String fileName = upload.getClientFileName();
                                String fileType = fileExt(upload.getClientFileName());
                                cleanUserFolder(userName);
                                String 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

         
            try {
              File file = new File(System.getProperty("java.io.tmpdir") + "/" +
                fileUpload.getClientFileName());
           
              fileUpload.writeTo(file);
            } catch (IOException e) {
         e.printStackTrace();
       }
        }
      }
View Full Code Here

                    if (importFile.exists())
                    {
                        importFile.delete();
                    }

                    upload.writeTo(importFile);
                }
                catch (IOException ioe)
                {
                    this.errorMessage = createMessage("import.message.exception", new Object[]
                    { upload.getClientFileName(), ioe.getMessage()});
View Full Code Here

        checkFileExists(newFile);
        try
        {
          // Save to new file
          newFile.createNewFile();
          upload.writeTo(newFile);

          UploadPage.this.info("saved file: " + upload.getClientFileName());
        }
        catch (Exception e)
        {
View Full Code Here

        checkFileExists(newFile);
        try
        {
          // Save to new file
          newFile.createNewFile();
          upload.writeTo(newFile);

          MultiUploadPage.this.info("saved file: " + upload.getClientFileName());
        }
        catch (Exception e)
        {
View Full Code Here

        checkFileExists(newFile);
        try
        {
          // Save to new file
          newFile.createNewFile();
          upload.writeTo(newFile);

          UploadPage.this.info("saved file: " + upload.getClientFileName());
        }
        catch (Exception e)
        {
View Full Code Here

            getSession().error(getString("artifact.follow.pom.error.noFile"));
            return;
          }
         
          pomFile = File.createTempFile("uploaded-pom-", ".xml", configurer.getTmpDirectory());
          fileUpload.writeTo(pomFile);
         
          PomBean pomBean = mavenCentralSearchApiService.searchFromPom(pomFile);
          ArtifactPomSearchPanel.this.pomBeanModel.setObject(pomBean);
          ArtifactPomSearchPanel.this.pomContentModel.setObject(null);
        } catch (Exception e) {
View Full Code Here

            getSession().error(getString("console.import.project.error.noFile"));
            return;
          }
         
          file = File.createTempFile("uploaded-", ".xls", configurer.getTmpDirectory());
          fileUpload.writeTo(file);
         
          projectImportDataService.importProjects(file);
         
          Session.get().success(getString("console.import.project.success"));
        } catch (Exception e) {
View Full Code Here

          // }
        } else if (clientFileName.endsWith(".xls") == true) {
          final StringBuffer buf = new StringBuffer();
          buf.append("report_").append(FileHelper.createSafeFilename(PFUserContext.getUser().getUsername(), 20)).append(".xls");
          final File file = new File(ConfigXml.getInstance().getWorkingDirectory(), buf.toString());
          fileUpload.writeTo(file);
          getReportScriptingStorage().setFilename(clientFileName, file.getAbsolutePath());
        } else {
          log.error("File extension not supported: " + clientFileName);
        }
      } catch (final Exception ex) {
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.