cziegeler 2004/05/24 04:15:40
Modified: src/java/org/apache/cocoon/environment/wrapper
MutableEnvironmentFacade.java
EnvironmentWrapper.java
. status.xml
src/java/org/apache/cocoon/environment
AbstractEnvironment.java Environment.java
Log:
Remove deprecated getOutputStream() method from Environment.
Revision Changes Path
1.8 +1 -8
cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
Index: MutableEnvironmentFacade.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MutableEnvironmentFacade.java 18 Mar 2004 15:08:12 -0000 1.7
+++ MutableEnvironmentFacade.java 24 May 2004 11:15:40 -0000 1.8
@@ -188,13 +188,6 @@
}
/* (non-Javadoc)
- * @see org.apache.cocoon.environment.Environment#getOutputStream()
- */
- public OutputStream getOutputStream() throws IOException {
- return env.getOutputStream();
- }
-
- /* (non-Javadoc)
* @see org.apache.cocoon.environment.Environment#getOutputStream(int)
*/
public OutputStream getOutputStream(int bufferSize) throws IOException {
1.16 +18 -31
cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
Index: EnvironmentWrapper.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- EnvironmentWrapper.java 18 Mar 2004 15:08:12 -0000 1.15
+++ EnvironmentWrapper.java 24 May 2004 11:15:40 -0000 1.16
@@ -278,17 +278,6 @@
/**
* Get the output stream
- * @deprecated use [EMAIL PROTECTED] #getOutputStream(int)} instead.
- */
- public OutputStream getOutputStream()
- throws IOException {
- return this.outputStream == null
- ? this.environment.getOutputStream()
- : this.outputStream;
- }
-
- /**
- * Get the output stream
*/
public OutputStream getOutputStream(int bufferSize)
throws IOException {
@@ -305,35 +294,33 @@
this.outputStream = stream;
}
- /**
- * Reset the response if possible. This allows error handlers to have
- * a higher chance to produce clean output if the pipeline that raised
- * the error has already output some data.
- *
- * @return true if the response was successfully reset
- */
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#tryResetResponse()
+ */
public boolean tryResetResponse()
throws IOException {
- if (getOutputStream() != null
- && getOutputStream() instanceof BufferedOutputStream) {
- ((BufferedOutputStream)getOutputStream()).clearBuffer();
+ final OutputStream os = this.getOutputStream(-1);
+ if (os != null
+ && os instanceof BufferedOutputStream) {
+ ((BufferedOutputStream)os).clearBuffer();
return true;
+ } else {
+ return super.tryResetResponse();
}
- else
- return super.tryResetResponse();
}
- /**
- * Commit the response
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#commitResponse()
*/
public void commitResponse()
throws IOException {
- if (getOutputStream() != null
- && getOutputStream() instanceof BufferedOutputStream) {
- ((BufferedOutputStream)getOutputStream()).realFlush();
+ final OutputStream os = this.getOutputStream(-1);
+ if (os != null
+ && os instanceof BufferedOutputStream) {
+ ((BufferedOutputStream)os).realFlush();
+ } else {
+ super.commitResponse();
}
- else
- super.commitResponse();
}
/**
1.334 +4 -1 cocoon-2.1/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/status.xml,v
retrieving revision 1.333
retrieving revision 1.334
diff -u -r1.333 -r1.334
--- status.xml 24 May 2004 11:04:54 -0000 1.333
+++ status.xml 24 May 2004 11:15:40 -0000 1.334
@@ -211,6 +211,9 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="CZ" type="update">
+ Remove deprecated getOutputStream() method from Environment.
+ </action>
<action dev="CZ" type="fix">
Change the mime-type setting of a reader. For more information, see
<link
href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10277">bug entry
10277</link>.
1.20 +34 -49
cocoon-2.1/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
Index: AbstractEnvironment.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/AbstractEnvironment.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- AbstractEnvironment.java 18 Mar 2004 15:08:12 -0000 1.19
+++ AbstractEnvironment.java 24 May 2004 11:15:40 -0000 1.20
@@ -338,25 +338,21 @@
return this.view;
}
- /**
- * Returns the request action
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#getAction()
*/
public String getAction() {
return this.action;
}
- // Response methods
-
- /**
- * Set a status code
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#setStatus(int)
*/
public void setStatus(int statusCode) {
}
- // Object model method
-
- /**
- * Returns a Map containing environment specific objects
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#getObjectModel()
*/
public Map getObjectModel() {
return this.objectModel;
@@ -415,56 +411,50 @@
}
}
- /**
- * Check if the response has been modified since the same
- * "resource" was requested.
- * The caller has to test if it is really the same "resource"
- * which is requested.
- * @return true if the response is modified or if the
- * environment is not able to test it
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.environment.Environment#isResponseModified(long)
*/
public boolean isResponseModified(long lastModified) {
return true; // always modified
}
- /**
- * Mark the response as not modified.
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.environment.Environment#setResponseIsNotModified()
*/
public void setResponseIsNotModified() {
// does nothing
}
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.environment.Environment#getAttribute(java.lang.String)
+ */
public Object getAttribute(String name) {
return this.attributes.get(name);
}
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.environment.Environment#setAttribute(java.lang.String,
java.lang.Object)
+ */
public void setAttribute(String name, Object value) {
this.attributes.put(name, value);
}
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.environment.Environment#removeAttribute(java.lang.String)
+ */
public void removeAttribute(String name) {
this.attributes.remove(name);
}
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#getAttributeNames()
+ */
public Enumeration getAttributeNames() {
return new IteratorEnumeration(this.attributes.keySet().iterator());
}
- /**
- * Get the output stream where to write the generated resource.
- * @deprecated Use [EMAIL PROTECTED] #getOutputStream(int)} instead.
- */
- public OutputStream getOutputStream() throws IOException {
- // by default we use the complete buffering output stream
- return this.getOutputStream(-1);
- }
-
- /**
- * Get the output stream where to write the generated resource.
- * The returned stream is buffered by the environment. If the
- * buffer size is -1 then the complete output is buffered.
- * If the buffer size is 0, no buffering takes place.
- * This method replaces [EMAIL PROTECTED] #getOutputStream()}.
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#getOutputStream(int)
*/
public OutputStream getOutputStream(int bufferSize)
throws IOException {
@@ -481,13 +471,9 @@
}
}
- /**
- * Reset the response if possible. This allows error handlers to have
- * a higher chance to produce clean output if the pipeline that raised
- * the error has already output some data.
- *
- * @return true if the response was successfully reset
- */
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#tryResetResponse()
+ */
public boolean tryResetResponse()
throws IOException {
if (this.secureOutputStream != null) {
@@ -497,8 +483,8 @@
return false;
}
- /**
- * Commit the response
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#commitResponse()
*/
public void commitResponse()
throws IOException {
@@ -570,16 +556,15 @@
}
}
- /**
- * Notify that the processing starts.
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#startingProcessing()
*/
public void startingProcessing() {
// do nothing here
}
- /**
- * Notify that the processing is finished
- * This can be used to cleanup the environment object
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#finishingProcessing()
*/
public void finishingProcessing() {
if ( null != this.manager ) {
1.8 +1 -8
cocoon-2.1/src/java/org/apache/cocoon/environment/Environment.java
Index: Environment.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/Environment.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Environment.java 18 Mar 2004 15:08:12 -0000 1.7
+++ Environment.java 24 May 2004 11:15:40 -0000 1.8
@@ -99,16 +99,9 @@
/**
* Get the output stream where to write the generated resource.
- * @deprecated Use [EMAIL PROTECTED] #getOutputStream(int)} instead.
- */
- OutputStream getOutputStream() throws IOException;
-
- /**
- * Get the output stream where to write the generated resource.
* The returned stream is buffered by the environment. If the
* buffer size is -1 then the complete output is buffered.
* If the buffer size is 0, no buffering takes place.
- * This method replaces [EMAIL PROTECTED] #getOutputStream()}.
*/
OutputStream getOutputStream(int bufferSize) throws IOException;