01: /* $Id: HTMLImage.java,v 1.1.1.1 2002/10/02 18:42:54 wastl Exp $ */
02: package net.wastl.webmail.ui.html;
03:
04: import net.wastl.webmail.server.*;
05: import net.wastl.webmail.exceptions.*;
06: import net.wastl.webmail.misc.ByteStore;
07: import java.util.Locale;
08:
09: /*
10: * HTMLImage.java
11: *
12: * Created: Wed Feb 3 18:23:28 1999
13: *
14: * Copyright (C) 1999-2000 Sebastian Schaffert
15: *
16: * This program is free software; you can redistribute it and/or
17: * modify it under the terms of the GNU General Public License
18: * as published by the Free Software Foundation; either version 2
19: * of the License, or (at your option) any later version.
20: *
21: * This program is distributed in the hope that it will be useful,
22: * but WITHOUT ANY WARRANTY; without even the implied warranty of
23: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24: * GNU General Public License for more details.
25: *
26: * You should have received a copy of the GNU General Public License
27: * along with this program; if not, write to the Free Software
28: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29: */
30: /**
31: * A HTML Document that is actually an image.:-)
32: *
33: * @author Sebastian Schaffert
34: * @version $Revision: 1.1.1.1 $
35: */
36:
37: public class HTMLImage extends HTMLDocument {
38:
39: public ByteStore cont;
40:
41: public HTMLImage(ByteStore content) {
42: this .cont = content;
43: }
44:
45: public HTMLImage(Storage store, String name, Locale locale,
46: String theme) throws WebMailException {
47: cont = new ByteStore(store.getBinaryFile(name, locale, theme));
48: cont.setContentType(store.getMimeType(name));
49: cont.setContentEncoding("BINARY");
50: }
51:
52: public int size() {
53: if (cont == null) {
54: return 0;
55: } else {
56: return cont.getSize();
57: }
58: }
59:
60: public String getContentEncoding() {
61: return cont.getContentEncoding();
62: }
63:
64: public String getContentType() {
65: return cont.getContentType();
66: }
67:
68: public byte[] toBinary() {
69: return cont.getBytes();
70: }
71:
72: } // HTMLImage
|