/** * @see Media#getFormat() */ public String getFormat() { return _media.getFormat(); }
/** * @see Media#isContentDisposition() */ public boolean isContentDisposition() { return _media.isContentDisposition(); } }
/** * @see Media#getName() */ public String getName() { return _media.getName(); }
/** Open a download dialog to save the specified content at the client * with the suggested file name.<br/> * Note: You don't need to close the content (a Reader), it will be closed automatically after download. * @param content the content * @param contentType the content type (a.k.a., MIME type), * 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); }
private static String getContentType(String format) { final String ctype = ContentTypes.getContentType(format); return ctype != null ? ctype: "audio/" + format; } private static String getFormatByName(String name) {
/** * @see Media#isBinary() */ public boolean isBinary() { return _media.isBinary(); }
public String getFormat() { if (_format == null) { _format = ContentTypes.getFormat(getContentType()); } return _format; }
/** * @see Media#getByteData() */ public byte[] getByteData() { return _media.getByteData(); }
/** * @see Media#getContentType() */ public String getContentType() { return _media.getContentType(); }
/** * @see Media#getStringData() */ public String getStringData() { return _media.getStringData(); }
/** * @see Media#inMemory() */ public boolean inMemory() { return _media.inMemory(); }
/** Open a download dialog to save the specified content at the client * with the suggested file name.<br/> * Note: You don't need to close the content (a InputStream), it will be closed automatically after download. * @param content the content * @param contentType the content type (a.k.a., MIME type), * 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); }
private static String getContentType(String format) { final String ctype = ContentTypes.getContentType(format); return ctype != null ? ctype: "image/" + format; } private static String getFormatByName(String name) {
public String getFormat() { if (_format == null) { _format = ContentTypes.getFormat(getContentType()); } return _format; }
/** Open a download dialog to save the specified content at the client * with the suggested file name. * * @param content the content * @param contentType the content type (a.k.a., MIME type), * 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); }
private static String getContentType(String format) { final String ctype = ContentTypes.getContentType(format); return ctype != null ? ctype : "video/" + format; }
public String getFormat() { if (_format == null) { _format = ContentTypes.getFormat(getContentType()); } return _format; }
/** Open a download dialog to save the specified content at the client * with the suggested file name. * * @param content the content * @param contentType the content type (a.k.a., MIME type), * 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); }
public String getFormat() { if (_format == null) { _format = ContentTypes.getFormat(getContentType()); } return _format; }