You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/08/08 01:42:38 UTC
svn commit: r683752 -
/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/ObjectType.java
Author: hansbak
Date: Thu Aug 7 16:42:38 2008
New Revision: 683752
URL: http://svn.apache.org/viewvc?rev=683752&view=rev
Log:
added buffer conversion which is required by the persistContentAndAssoc service to store email attachments
Modified:
ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/ObjectType.java
Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/ObjectType.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/ObjectType.java?rev=683752&r1=683751&r2=683752&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/ObjectType.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/ObjectType.java Thu Aug 7 16:42:38 2008
@@ -26,6 +26,7 @@
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.*;
+import java.nio.*;
import javolution.util.FastList;
import javolution.util.FastMap;
@@ -952,6 +953,14 @@
} else {
throw new GeneralException("Conversion from " + fromType + " to " + type + " not currently supported");
}
+ } else if (obj instanceof java.nio.Buffer) {
+ fromType = "Buffer";
+ Buffer buffer = (Buffer) obj;
+ if ("java.nio.ByteBuffer".equals(type)) {
+ return buffer;
+ } else {
+ throw new GeneralException("Conversion from " + fromType + " to " + type + " not currently supported");
+ }
} else {
// we can pretty much always do a conversion to a String, so do that here
if ("String".equals(type) || "java.lang.String".equals(type)) {