01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal;
07:
08: import java.io.IOException;
09: import java.io.OutputStream;
10: import java.util.Map;
11:
12: /**
13: * An interface that a channel that wants to download MIME files must implement.
14: * @author Shridar Venkatesh, svenkatesh@interactivebusiness.com
15: * @version $Revision: 34818 $
16: */
17: public interface IMimeResponse {
18:
19: /**
20: * Returns the MIME type of the content.
21: */
22: public java.lang.String getContentType();
23:
24: /**
25: * Returns the MIME content in the form of an input stream.
26: * Returns null if the code needs the OutputStream object
27: */
28: public java.io.InputStream getInputStream() throws IOException;
29:
30: /**
31: * Pass the OutputStream object to the download code if it needs special handling
32: * (like outputting a Zip file).
33: */
34: public void downloadData(OutputStream out) throws IOException;
35:
36: /**
37: * Returns the name of the MIME file.
38: */
39: public java.lang.String getName();
40:
41: /**
42: * Returns a list of header values that can be set in the HttpResponse.
43: * Returns null if no headers need to be set.
44: */
45: public Map getHeaders();
46:
47: /**
48: * Let the channel know that there were problems with the download
49: *
50: * @param e
51: */
52: public void reportDownloadError(Exception e);
53: }
|