Package org.apache.wicket.util.file

Examples of org.apache.wicket.util.file.Folder


   * @param parameters
   *            Page parameters
   */
  public MultiUploadPage(final PageParameters parameters)
  {
    Folder uploadFolder = getUploadFolder();

    // Create feedback panels
    final FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback");

    // Add uploadFeedback to the page itself
    add(uploadFeedback);

    // Add simple upload form, which is hooked up to its feedback panel by
    // virtue of that panel being nested in the form.
    final FileUploadForm simpleUploadForm = new FileUploadForm("simpleUpload");
    add(simpleUploadForm);

    // Add folder view
    add(new Label("dir", uploadFolder.getAbsolutePath()));
    fileListView = new FileListView("fileList", new LoadableDetachableModel<List<File>>()
    {
      @Override
      protected List<File> load()
      {
View Full Code Here


   * @param parameters
   *            Page parameters
   */
  public UploadPage(final PageParameters parameters)
  {
    Folder uploadFolder = getUploadFolder();

    // Create feedback panels
    final FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback");

    // Add uploadFeedback to the page itself
    add(uploadFeedback);

    // Add simple upload form, which is hooked up to its feedback panel by
    // virtue of that panel being nested in the form.
    final FileUploadForm simpleUploadForm = new FileUploadForm("simpleUpload");
    add(simpleUploadForm);

    // Add folder view
    add(new Label("dir", uploadFolder.getAbsolutePath()));
    fileListView = new FileListView("fileList", new LoadableDetachableModel<List<File>>()
    {
      @Override
      protected List<File> load()
      {
View Full Code Here

      this.getClass().getName().replace('.', '/'), null, null, null, "txt", false);
    String path = getPath(resource);
    path = Strings.beforeLastPathComponent(path, '/') + "/sourcePath";

    // and execute
    executeMultiple(new Path(new Folder(path)));
  }
View Full Code Here

   * @param parameters
   *            Page parameters
   */
  public MultiUploadPage(final PageParameters parameters)
  {
    Folder uploadFolder = getUploadFolder();

    // Create feedback panels
    final FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback");

    // Add uploadFeedback to the page itself
    add(uploadFeedback);

    // Add simple upload form, which is hooked up to its feedback panel by
    // virtue of that panel being nested in the form.
    final FileUploadForm simpleUploadForm = new FileUploadForm("simpleUpload");
    add(simpleUploadForm);

    // Add folder view
    add(new Label("dir", uploadFolder.getAbsolutePath()));
    fileListView = new FileListView("fileList", new LoadableDetachableModel<List<File>>()
    {
      @Override
      protected List<File> load()
      {
View Full Code Here

   * @param parameters
   *            Page parameters
   */
  public UploadPage(final PageParameters parameters)
  {
    Folder uploadFolder = getUploadFolder();

    // Create feedback panels
    final FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback");

    // Add uploadFeedback to the page itself
    add(uploadFeedback);

    // Add simple upload form, which is hooked up to its feedback panel by
    // virtue of that panel being nested in the form.
    final FileUploadForm simpleUploadForm = new FileUploadForm("simpleUpload");
    add(simpleUploadForm);

    // Add folder view
    add(new Label("dir", uploadFolder.getAbsolutePath()));
    fileListView = new FileListView("fileList", new LoadableDetachableModel<List<File>>()
    {
      @Override
      protected List<File> load()
      {
View Full Code Here

  @Override
  protected void init()
  {
    getResourceSettings().setThrowExceptionOnMissingResource(false);

    uploadFolder = new Folder(System.getProperty("java.io.tmpdir"), "wicket-uploads");
    // Ensure folder exists
    uploadFolder.mkdirs();

    mountBookmarkablePage("/multi", MultiUploadPage.class);
    mountBookmarkablePage("/single", UploadPage.class);
View Full Code Here

   * @param parameters
   *            Page parameters
   */
  public MultiUploadPage(final PageParameters parameters)
  {
    Folder uploadFolder = getUploadFolder();

    // Create feedback panels
    final FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback");

    // Add uploadFeedback to the page itself
    add(uploadFeedback);

    // Add simple upload form, which is hooked up to its feedback panel by
    // virtue of that panel being nested in the form.
    final FileUploadForm simpleUploadForm = new FileUploadForm("simpleUpload");
    add(simpleUploadForm);

    // Add folder view
    add(new Label<String>("dir", uploadFolder.getAbsolutePath()));
    fileListView = new FileListView("fileList", new LoadableDetachableModel<List<File>>()
    {
      @Override
      protected List<File> load()
      {
View Full Code Here

   * @param parameters
   *            Page parameters
   */
  public UploadPage(final PageParameters parameters)
  {
    Folder uploadFolder = getUploadFolder();

    // Create feedback panels
    final FeedbackPanel uploadFeedback = new FeedbackPanel("uploadFeedback");

    // Add uploadFeedback to the page itself
    add(uploadFeedback);

    // Add simple upload form, which is hooked up to its feedback panel by
    // virtue of that panel being nested in the form.
    final FileUploadForm simpleUploadForm = new FileUploadForm("simpleUpload");
    add(simpleUploadForm);

    // Add folder view
    add(new Label<String>("dir", uploadFolder.getAbsolutePath()));
    fileListView = new FileListView("fileList", new LoadableDetachableModel<List<File>>()
    {
      @Override
      protected List<File> load()
      {
View Full Code Here

    IResourceStream resource = locator.locate(getClass(),this.getClass().getName().replace('.', '/'), null, null, "txt");
    String path = getPath(resource);
    path = Strings.beforeLastPathComponent(path, '/') + "/sourcePath";

    // and execute
    executeMultiple(new Path(new Folder(path)));
  }
View Full Code Here

    }
  }

  private static Folder getUploadFolder() {
    if (uploadFolder == null) {
      uploadFolder = new Folder(System.getProperty("java.io.tmpdir"),
          "wicket-uploads");
      boolean created = uploadFolder.mkdirs();
      if (!created && !uploadFolder.exists()) {
        throw new IllegalStateException("Unable to create " + uploadFolder);
      }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.file.Folder

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.