Package org.zkoss.util.media

Examples of org.zkoss.util.media.AMedia


  }

  public void setMedia(String name, String contentType, File file) {
    try {
      if (file != null && file.exists()) {
        setMedia(new AMedia(name, null, contentType, file, true));
      } else {
        setMedia(null);
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
View Full Code Here


  }
 
  private class ExtraCtrl implements SpreadsheetCtrl,SpreadsheetInCtrl,SpreadsheetOutCtrl,DynamicMedia {

    public Media getMedia(String pathInfo) {
      return new AMedia("css", "css", "text/css;charset=UTF-8", getSheetDefaultRules());
    }
View Full Code Here

   * e.g., application/pdf
   * @param flnm the suggested file name, e.g., myfile.pdf.
   * If null, no suggested name is provided.
   */
  public static void save(byte[] content, String contentType, String flnm) {
    save(new AMedia(flnm, null, contentType, content), flnm);
  }
View Full Code Here

   * e.g., application/pdf
   * @param flnm the suggested file name, e.g., myfile.pdf.
   * If null, no suggested name is provided.
   */
  public static void save(String content, String contentType, String flnm) {
    save(new AMedia(flnm, null, contentType, content), flnm);
  }
View Full Code Here

   * e.g., application/pdf
   * @param flnm the suggested file name, e.g., myfile.pdf.
   * If null, no suggested name is provided.
   */
  public static void save(InputStream content, String contentType, String flnm) {
    save(new AMedia(flnm, null, contentType, content), flnm);
  }
View Full Code Here

   * e.g., application/pdf
   * @param flnm the suggested file name, e.g., myfile.pdf.
   * If null, no suggested name is provided.
   */
  public static void save(Reader content, String contentType, String flnm) {
    save(new AMedia(flnm, null, contentType, content), flnm);
  }
View Full Code Here

   * @exception FileNotFoundException if the file is not found.
   * @since 3.0.8
   */
  public static void save(File file, String contentType)
  throws FileNotFoundException {
    save(new AMedia(file, contentType, null), file.getName());
  }
View Full Code Here

  throws FileNotFoundException {
    String name = url.toExternalForm();
    int j = name.lastIndexOf('/');
    if (j >= 0 && j < name.length() - 1)
      name = name.substring(j + 1);
    save(new AMedia(url, contentType, null), name);
  }
View Full Code Here

   * It is used only by component developers.
   */
  protected class ExtraCtrl implements DynamicMedia {
    //-- DynamicMedia --//
    public Media getMedia(String pathInfo) {
      return new AMedia("css", "css", "text/css;charset=UTF-8", getContent());
    }
View Full Code Here

                fi.getInputStream());
          if (charset == null)
            charset = conf.getUploadCharset();
        }
        return fi.isInMemory() ?
          new AMedia(name, null, ctype, fi.getString(charset)):
          new ReaderMedia(name, null, ctype, fi, charset);
      }
    }

    return fi.isInMemory() ?
      new AMedia(name, null, ctype, fi.get()):
      new StreamMedia(name, null, ctype, fi);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.util.media.AMedia

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.