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 multithreaded channel that wants to download MIME files must implement.
14: * @author Alex Vigdor
15: * @version $Revision: 36380 $
16: *
17: * @deprecated Use the IChannel* interfaces instead or write a portlet. For more information see:
18: * http://www.ja-sig.org/wiki/display/UPC/Proposal+to+Deprecate+IMultithreaded+Interfaces
19: */
20:
21: public interface IMultithreadedMimeResponse {
22:
23: /**
24: * Returns the MIME type of the content.
25: */
26: public java.lang.String getContentType(String uid);
27:
28: /**
29: * Returns the MIME content in the form of an input stream.
30: * Returns null if the code needs the OutputStream object
31: */
32: public java.io.InputStream getInputStream(String uid)
33: throws IOException;
34:
35: /**
36: * Pass the OutputStream object to the download code if it needs special handling
37: * (like outputting a Zip file).
38: */
39: public void downloadData(OutputStream out, String uid)
40: throws IOException;
41:
42: /**
43: * Returns the name of the MIME file.
44: */
45: public java.lang.String getName(String uid);
46:
47: /**
48: * Returns a list of header values that can be set in the HttpResponse.
49: * Returns null if no headers need to be set.
50: */
51: public Map getHeaders(String uid);
52:
53: /**
54: * Let the channel know that there were problems with the download
55: * @param e
56: */
57: public void reportDownloadError(Exception e);
58: }
|