Package org.apache.wicket.util.lang

Examples of org.apache.wicket.util.lang.Bytes


   *            list of files chosen in the upload field, not-null
   */
  protected void addErrorMsg(AjaxRequestTarget target, FileList fileList)
  {
    FormComponent<?> component = getFormComponent();
    Bytes maxSize = getMaxSize();
    final Map<String, Object> model = new HashMap<String, Object>();
    model.put("maxSize", maxSize);
    final String defaultValue = "Upload must be less than " + maxSize;
    String msg = component.getString(component.getId() + "." + UPLOAD_TOO_LARGE_RESOURCE_KEY,
      Model.ofMap(model), defaultValue);
View Full Code Here


          close();
        }
      }

      data.setContentDisposition(contentDisposition);
      Bytes length = stream.length();
      if (length != null)
      {
        data.setContentLength(length.bytes());
      }
      data.setFileName(fileName);

      final String contentType;
      if (fileName != null && Application.exists())
View Full Code Here

          close();
        }
      }

      data.setContentDisposition(contentDisposition);
      Bytes length = resourceStream.length();
      if (length != null)
      {
        data.setContentLength(length.bytes());
      }
      data.setFileName(fileName);

      String contentType = resourceStream.getContentType();
      if (contentType == null && fileName != null && Application.exists())
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.lang.Bytes

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.