KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > services > HttpContentItem


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jul 11, 2005
14  * @author James Dixon
15  *
16  */

17 package org.pentaho.core.services;
18
19 import java.io.InputStream JavaDoc;
20 import java.io.OutputStream JavaDoc;
21 import java.io.Reader JavaDoc;
22 import java.util.Date JavaDoc;
23 import java.util.List JavaDoc;
24
25 import javax.activation.FileDataSource JavaDoc;
26
27 import org.pentaho.core.repository.IContentItem;
28 import org.pentaho.core.solution.HttpOutputHandler;
29 import org.pentaho.core.repository.content.ContentException;
30
31 public class HttpContentItem implements IContentItem {
32
33     private String JavaDoc mimeType;
34
35     private OutputStream JavaDoc outputStream;
36
37     private HttpOutputHandler outputHandler;
38
39     public HttpContentItem(OutputStream JavaDoc outputStream, HttpOutputHandler outputHandler) {
40         this.outputStream = outputStream;
41         this.outputHandler = outputHandler;
42     }
43
44     public String JavaDoc getId() {
45         return null;
46     }
47
48     public String JavaDoc getPath() {
49         return null;
50     }
51
52     public String JavaDoc getName() {
53         return null;
54     }
55
56     public String JavaDoc getTitle() {
57         return null;
58     }
59
60     public String JavaDoc getMimeType() {
61         return mimeType;
62     }
63
64     public void setMimeType(String JavaDoc mimeType) {
65         this.mimeType = mimeType;
66         outputHandler.setMimeType(mimeType);
67     }
68
69     public String JavaDoc getUrl() {
70         return null;
71     }
72
73     public List JavaDoc getFileVersions() {
74         return null;
75     }
76
77     public void removeAllVersions() {
78     }
79
80     public void removeVersion(String JavaDoc fileId) {
81     }
82
83     public InputStream JavaDoc getInputStream() throws ContentException {
84         return null;
85     }
86
87     public FileDataSource JavaDoc getDataSource() {
88         // TODO
89
return null;
90     }
91
92     public Reader JavaDoc getReader() throws ContentException {
93         return null;
94     }
95
96     public OutputStream JavaDoc getOutputStream(String JavaDoc actionName) {
97         if (mimeType == null) {
98             setMimeType("text/html"); //$NON-NLS-1$
99
}
100         return outputStream;
101     }
102
103     public String JavaDoc getActionName() {
104         return null;
105     }
106
107     public String JavaDoc getFileId() {
108         return null;
109     }
110
111     public long getFileSize() {
112         return 0;
113     }
114
115     public Date JavaDoc getFileDateTime() {
116         return null;
117     }
118     
119     public void makeTransient() {
120       // NOOP
121
}
122
123 }
124
Popular Tags