de.oio.bugkilla.splitter
Class FailureServletOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--javax.servlet.ServletOutputStream
              |
              +--de.oio.bugkilla.splitter.FailureServletOutputStream

public class FailureServletOutputStream
extends javax.servlet.ServletOutputStream

The FailureServletOutputStream represents a class that only has the abiblity to write out an error message.

Author:
swinkler

Constructor Summary
FailureServletOutputStream(javax.servlet.http.HttpServletResponse response)
          Constructs a new FailureServletOutputStream that sends a failure message to the client.
 
Method Summary
 java.lang.String getError()
          Returns the current error message that will be sent to the client if an error occured.
 void setError(java.lang.String error)
          Sets the specified error message that will be sent to the client if an error occured.
 void write(byte[] b)
          Writes the specified error message to the original reponse output stream.
 void write(byte[] b, int off, int len)
          Writes the specified error message to the original reponse output stream.
 void write(int b)
          Writes the specified error message to the original reponse output stream.
 
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FailureServletOutputStream

public FailureServletOutputStream(javax.servlet.http.HttpServletResponse response)
Constructs a new FailureServletOutputStream that sends a failure message to the client.

Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes the specified error message to the original reponse output stream. The given parameter will be ignored.

Specified by:
write in class java.io.OutputStream
Parameters:
b - - the byte.
Throws:
java.io.IOException - - if an I/O error occurs.

write

public void write(byte[] b)
           throws java.io.IOException
Writes the specified error message to the original reponse output stream. The given parameter will be ignored.

Overrides:
write in class java.io.OutputStream
Parameters:
b - - the data.
Throws:
java.io.IOException - - if an I/O error occurs.
See Also:
write(byte[] b, int off, int len)

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes the specified error message to the original reponse output stream. The given parameter will be ignored.

Overrides:
write in class java.io.OutputStream
Parameters:
b - - the data.
off - - the start offset in the data.
len - - the number of bytes to write.
Throws:
java.io.IOException - - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.

getError

public java.lang.String getError()
Returns the current error message that will be sent to the client if an error occured.

Returns:
an error message String

setError

public void setError(java.lang.String error)
Sets the specified error message that will be sent to the client if an error occured.

Parameters:
error - The error message that will be sent to the client if an error occured.


Copyright © Orientation in Objects GmbH. All Rights Reserved.