Author: jleroux
Date: Thu Sep 29 00:34:43 2011
New Revision: 1177128
URL:
http://svn.apache.org/viewvc?rev=1177128&view=revLog:
A patch from Martin Kreidenweis "updateContentAndUploadedFile service broken"
https://issues.apache.org/jira/browse/OFBIZ-4452The updateContentAndUploadedFile service doesn't work correctly: When the new file is shorter (smaller) than the old file, only part of the file is replaced; it keeps its original size.
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java?rev=1177128&r1=1177127&r2=1177128&view=diff==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java Thu Sep 29 00:34:43 2011
@@ -450,6 +450,7 @@ public class DataServices {
} else if (binData != null) {
try {
RandomAccessFile out = new RandomAccessFile(file, "rw");
+ out.setLength(binData.array().length);
out.write(binData.array());
out.close();
} catch (FileNotFoundException e) {