Package org.apache.wicket.util.upload

Examples of org.apache.wicket.util.upload.FileUploadException


        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();

        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());
View Full Code Here


        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();

        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();

        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();
        // Create model with exception and maximum size values
        final Map model = new HashMap();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());

        if (e instanceof SizeLimitExceededException)
        {
          // Resource key should be <form-id>.uploadTooLarge to
          // override default message
          final String defaultValue = "Upload must be less than " + getMaxSize();
          String msg = getString(getId() + "." + UPLOAD_TOO_LARGE_RESOURCE_KEY,
            Model.valueOf(model), defaultValue);
          error(msg);
        }
        else
        {
          // Resource key should be <form-id>.uploadFailed to override
          // default message
          final String defaultValue = "Upload failed: " + e.getLocalizedMessage();
          String msg = getString(getId() + "." + UPLOAD_FAILED_RESOURCE_KEY,
            Model.valueOf(model), defaultValue);
          error(msg);

          log.warn(msg, e);
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();
        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());

        if (e instanceof SizeLimitExceededException)
        {
          // Resource key should be <form-id>.uploadTooLarge to
          // override default message
          final String defaultValue = "Upload must be less than " + getMaxSize();
          String msg = getString(getId() + "." + UPLOAD_TOO_LARGE_RESOURCE_KEY,
            Model.of(model), defaultValue);
          error(msg);
        }
        else
        {
          // Resource key should be <form-id>.uploadFailed to override
          // default message
          final String defaultValue = "Upload failed: " + e.getLocalizedMessage();
          String msg = getString(getId() + "." + UPLOAD_FAILED_RESOURCE_KEY,
            Model.of(model), defaultValue);
          error(msg);

          log.warn(msg, e);
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();

        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();
        // Create model with exception and maximum size values
        final Map model = new HashMap();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());

        if (e instanceof SizeLimitExceededException)
        {
          // Resource key should be <form-id>.uploadTooLarge to
          // override default message
          final String defaultValue = "Upload must be less than " + getMaxSize();
          String msg = getString(getId() + "." + UPLOAD_TOO_LARGE_RESOURCE_KEY, Model
              .valueOf(model), defaultValue);
          error(msg);

          if (log.isDebugEnabled())
          {
            log.error(msg, e);
          }
          else
          {
            log.error(msg);
          }
        }
        else
        {
          // Resource key should be <form-id>.uploadFailed to override
          // default message
          final String defaultValue = "Upload failed: " + e.getLocalizedMessage();
          String msg = getString(getId() + "." + UPLOAD_FAILED_RESOURCE_KEY, Model
              .valueOf(model), defaultValue);
          error(msg);

          log.error(msg, e);
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();
        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());

        if (e instanceof SizeLimitExceededException)
        {
          // Resource key should be <form-id>.uploadTooLarge to
          // override default message
          final String defaultValue = "Upload must be less than " + getMaxSize();
          String msg = getString(getId() + "." + UPLOAD_TOO_LARGE_RESOURCE_KEY,
            Model.of(model), defaultValue);
          error(msg);
        }
        else
        {
          // Resource key should be <form-id>.uploadFailed to override
          // default message
          final String defaultValue = "Upload failed: " + e.getLocalizedMessage();
          String msg = getString(getId() + "." + UPLOAD_FAILED_RESOURCE_KEY,
            Model.of(model), defaultValue);
          error(msg);

          log.warn(msg, e);
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();
        // Create model with exception and maximum size values
        final Map model = new HashMap();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());

        if (e instanceof SizeLimitExceededException)
        {
          // Resource key should be <form-id>.uploadTooLarge to
          // override default message
          final String defaultValue = "Upload must be less than " + getMaxSize();
          String msg = getString(getId() + "." + UPLOAD_TOO_LARGE_RESOURCE_KEY,
            Model.valueOf(model), defaultValue);
          error(msg);
        }
        else
        {
          // Resource key should be <form-id>.uploadFailed to override
          // default message
          final String defaultValue = "Upload failed: " + e.getLocalizedMessage();
          String msg = getString(getId() + "." + UPLOAD_FAILED_RESOURCE_KEY,
            Model.valueOf(model), defaultValue);
          error(msg);

          log.warn(msg, e);
View Full Code Here

        if (wre.getCause() == null || !(wre.getCause() instanceof FileUploadException))
        {
          throw wre;
        }

        FileUploadException e = (FileUploadException)wre.getCause();

        // Create model with exception and maximum size values
        final Map<String, Object> model = new HashMap<String, Object>();
        model.put("exception", e);
        model.put("maxSize", getMaxSize());
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.upload.FileUploadException

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.