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.components;
19:
20: import de.finix.contelligent.CallData;
21: import de.finix.contelligent.ExtensionProvider;
22: import de.finix.contelligent.content.ContelligentBinaryContent;
23: import de.finix.contelligent.content.Content;
24: import de.finix.contelligent.content.ContentProvider;
25: import de.finix.contelligent.logging.LoggingService;
26: import de.finix.contelligent.render.BinaryRenderer;
27: import de.finix.contelligent.render.Renderable;
28: import de.finix.contelligent.render.Renderer;
29:
30: public class CBinary extends Folder implements Renderable,
31: ContentProvider, ExtensionProvider {
32: final static org.apache.log4j.Logger log = LoggingService
33: .getLogger(CBinary.class);
34:
35: private BinaryRenderer renderer;
36:
37: private ContelligentBinaryContent content;
38:
39: public void postCreate() throws Exception {
40: content = new ContelligentBinaryContent(this );
41: renderer = new BinaryRenderer(this );
42: }
43:
44: public Renderer getRenderer() {
45: return renderer;
46: }
47:
48: public Content getContent() {
49: return content;
50: }
51:
52: public String getExtension(CallData callData) {
53: try {
54: return "." + content.getExtension(callData);
55: } catch (Exception e) {
56: return Renderable.TYPE_SUFFIX;
57: }
58: }
59: }
|