remm 01/04/16 19:49:32
Modified: src/stores/slidestore/reference JDBCContentStore.java
Log:
- When the content length is unknown, the contents of the request have to
be written to a temp file before writing it into the database. However, the code
(which was cut and pasted from the FileContentStore), was incorrectly checking the
content length in the descriptors (which was -1 in that case), and that was leading
to incorrectly throwing an exception.
Patch submitted by Valeriy Podkolzin <[EMAIL PROTECTED]>
Revision Changes Path
1.5 +4 -16
jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java
Index: JDBCContentStore.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JDBCContentStore.java 2001/04/13 17:29:15 1.4
+++ JDBCContentStore.java 2001/04/17 02:49:31 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v 1.4
2001/04/13 17:29:15 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2001/04/13 17:29:15 $
+ * $Header:
/home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v 1.5
2001/04/17 02:49:31 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/04/17 02:49:31 $
*
* ====================================================================
*
@@ -89,7 +89,7 @@
* JDBC 2.0 compliant implementation of ContentStore.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class JDBCContentStore extends AbstractSimpleService
implements ContentStore {
@@ -595,18 +595,6 @@
position = position + nChar;
}
fos.close();
-
- if (position != contentLength) {
- if (position < contentLength) {
- // Not enough bytes read !!!
- throw new IOException("Not enough bytes read");
- }
- if (position > contentLength) {
- // Not enough bytes read !!!
- throw new IOException("Too many bytes read");
- }
- // FIXME : Delete the file
- }
is = new FileInputStream(tempFile);
contentLength = tempFile.length();