[OFBiz] SVN: r7443 - trunk/applications/content/src/org/ofbiz/content/openoffice
byersa@svn.ofbiz.org
byersa at svn.ofbiz.org
Fri Apr 28 07:15:32 CDT 2006
Author: byersa
Date: 2006-04-28 07:15:18 -0500 (Fri, 28 Apr 2006)
New Revision: 7443
Modified:
trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
Log:
Uncovered the code to delete temporary files after use.
Modified: trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java 2006-04-28 08:26:03 UTC (rev 7442)
+++ trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java 2006-04-28 12:15:18 UTC (rev 7443)
@@ -54,7 +54,6 @@
/**
* OpenOfficeServices Class
- *
* @author <a href="mailto:byersa at automationgroups.com">Al Byers</a>
*/
public class OpenOfficeServices {
@@ -62,6 +61,9 @@
/**
* Use OpenOffice to convert documents between types
+ * This service requires that the "content.temp.dir" directory be set in the content.properties file.
+ * This value should be operating system dependent with "\\" separators for Windows
+ * and "/" for Linux/Unix.
*/
public static Map convertDocumentByteWrapper(DispatchContext dctx, Map context) {
@@ -102,7 +104,7 @@
FileOutputStream fos = new FileOutputStream(fileIn);
fos.write(inByteArray);
fos.close();
- Debug.logInfo("fileIn:" + tempDir + fileInName, module);
+ Debug.logInfo("fileIn:" + tempDir + fileInName, module);
OpenOfficeWorker.convertOODocToFile(xmulticomponentfactory, tempDir + fileInName, tempDir + fileOutName, outputMimeType);
fileOut = new File(tempDir + fileOutName);
FileInputStream fis = new FileInputStream(fileOut);
@@ -129,8 +131,8 @@
Debug.logError(e, "Error in OpenOffice operation: ", module);
return ServiceUtil.returnError(e.toString());
} finally {
- //if (fileIn != null) fileIn.delete();
- //if (fileOut != null) fileOut.delete();
+ if (fileIn != null) fileIn.delete();
+ if (fileOut != null) fileOut.delete();
}
return results;
}
More information about the Svn
mailing list