servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r651588 - /servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/view/DotView.java
Date Fri, 25 Apr 2008 12:17:35 GMT
Author: gnodet
Date: Fri Apr 25 05:17:34 2008
New Revision: 651588

URL: http://svn.apache.org/viewvc?rev=651588&view=rev
Log:
Try to fix the dot graphs on mac/linux

Modified:
    servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/view/DotView.java

Modified: servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/view/DotView.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/view/DotView.java?rev=651588&r1=651587&r2=651588&view=diff
==============================================================================
--- servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/view/DotView.java
(original)
+++ servicemix/smx3/trunk/web/servicemix-web-console/src/main/java/org/apache/servicemix/web/view/DotView.java
Fri Apr 25 05:17:34 2008
@@ -63,9 +63,14 @@
             FileWriter w = new FileWriter(dotSrc);
             w.write(o.toString());
             w.close();
-            dotImg = File.createTempFile("smx_", ".dot." + getDotFormat());
-            
-            String cmd = "-T" + getDotFormat() + " \"" + dotSrc.getCanonicalPath() + "\"
-o\"" + dotImg.getAbsolutePath() + "\"";
+            dotImg = new File(dotSrc.getAbsolutePath() + "." + getDotFormat());
+
+            String cmd;
+            if (System.getProperty("os.name").contains("Windows")) {
+	            cmd = "-T" + getDotFormat() + " \"" + dotSrc.getAbsolutePath() + "\" -o\"" +
dotImg.getAbsolutePath() + "\"";
+            } else {
+	            cmd = "-T " + getDotFormat() + " " + dotSrc.getAbsolutePath() + " -o " + dotImg.getAbsolutePath();
+            }
             Dot.run(cmd);
             
             InputStream is = new FileInputStream(dotImg);
@@ -77,7 +82,7 @@
             FileUtil.copyInputStream(is, response.getOutputStream());
         } finally {
             if (dotSrc != null) {
-                //dotSrc.delete();
+                dotSrc.delete();
             }
             if (dotImg != null) {
                 dotImg.delete();



Mime
View raw message