01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.base.resource;
19:
20: import java.io.File;
21: import java.util.Map;
22:
23: public class ContelligentBinaryResource extends ContelligentResource {
24:
25: private String contentType;
26:
27: private String extension;
28:
29: private String source;
30:
31: /** The file referenced by this resource. */
32: private File referencedFile = null;
33:
34: public ContelligentBinaryResource(Map categoryMap, String source,
35: String contentType, String extension) {
36: super (categoryMap);
37: this .contentType = contentType;
38: this .extension = extension;
39: this .source = source;
40: }
41:
42: public void setContentType(String contentType) {
43: this .contentType = contentType;
44: }
45:
46: public void setExtension(String extension) {
47: this .extension = extension;
48: }
49:
50: public void setSource(String source) {
51: this .source = source;
52: }
53:
54: /**
55: * Set the file referenced by this resource.
56: *
57: * @param referencedFile
58: * the file this resource should now reference.
59: */
60: public void setReferencedFile(File referencedFile) {
61: if (this .referencedFile != referencedFile) {
62: this .referencedFile = referencedFile;
63: setModified(true);
64: }
65: }
66:
67: public String getContentType() {
68: return contentType;
69: }
70:
71: public String getExtension() {
72: return extension;
73: }
74:
75: public String getSource() {
76: return source;
77: }
78:
79: /**
80: * Get the file referenced by this resource.
81: *
82: * @return the file referenced by this resource.
83: */
84: public File getReferencedFile() {
85: return referencedFile;
86: }
87: }
|