001: package com.sun.portal.desktop;
002:
003: import java.util.*;
004: import java.text.*;
005: import java.net.*;
006: import java.io.*;
007: import javax.servlet.*;
008: import javax.servlet.http.*;
009:
010: /**
011: * A DesktopResponse encapsulates the HttpServletResponse that is passed
012: * to the provider, hiding and redefining those methods that are
013: * inappropriate to be called by a provider.
014: */
015:
016: class DesktopResponse extends HttpServletResponseWrapper {
017:
018: public DesktopResponse(HttpServletResponse response) {
019: super (response);
020: }
021:
022: /**
023: * @deprecated As of version 2.1, use encodeRedirectURL(String url) instead
024: */
025: public String encodeRedirectUrl(String url) {
026: return url;
027: }
028:
029: public String encodeRedirectURL(String url) {
030: return url;
031: }
032:
033: /**
034: * @deprecated As of version 2.1, use encodeURL(String url) instead
035: */
036: public String encodeUrl(String url) {
037: return url;
038: }
039:
040: public String encodeURL(String url) {
041: return url;
042: }
043:
044: public void sendError(int sc) {
045: throw new UnsupportedOperationException(
046: "sendError is not available to providers");
047: }
048:
049: public void sendError(int sc, String msg) {
050: throw new UnsupportedOperationException(
051: "sendError is not available to providers");
052: }
053:
054: public void sendRedirect(String location) throws IOException {
055: // Please see DesktopServlet.sendRedirect
056: setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
057: setHeader("Location", location);
058: }
059:
060: /**
061: * @deprecated As of version 2.1, due to ambiguous meaning of the message parameter. To
062: * set a status code use setStatus(int), to send an error with a description use sendError(int,
063: * String). Sets the status code and message for this response.
064: */
065: public void setStatus(int sc, String sm) {
066: throw new UnsupportedOperationException(
067: "setStatus is not available to providers");
068: }
069:
070: /* ServletResponse methods */
071:
072: public void flushBuffer() {
073: // do nothing
074: }
075:
076: public int getBufferSize() {
077: return 0;
078: }
079:
080: public ServletOutputStream getOutputStream() {
081: throw new UnsupportedOperationException(
082: "getOutputStream is not available to providers");
083:
084: }
085:
086: public java.io.PrintWriter getWriter() {
087: throw new UnsupportedOperationException(
088: "getWriter is not available to providers");
089: }
090:
091: public boolean isCommitted() {
092: return false;
093: }
094:
095: public void reset() {
096: throw new UnsupportedOperationException(
097: "reset is not available to providers");
098: }
099:
100: public void setBufferSize(int size) {
101: throw new UnsupportedOperationException(
102: "setBufferSize is not available to providers");
103: }
104:
105: public void setContentLength(int len) {
106: throw new UnsupportedOperationException(
107: "setContentLength is not available to providers");
108: }
109:
110: public void setContentType(String type) {
111: throw new UnsupportedOperationException(
112: "setContentType is not available to providers");
113: }
114:
115: public void setLocale(Locale loc) {
116: throw new UnsupportedOperationException(
117: "setLocale is not available to providers");
118: }
119: }
|