Author: jm
Date: 2012-10-30 07:30:03 -0700 (Tue, 30 Oct 2012)
New Revision: 30722

Modified:
   csplugins/trunk/toronto/jm/performance-reporter/pom.xml
   
csplugins/trunk/toronto/jm/performance-reporter/src/main/java/org/cytoscape/extras/performance/internal/GeneratePerformanceReportTaskFactory.java
Log:
Added proxy support

Modified: csplugins/trunk/toronto/jm/performance-reporter/pom.xml
===================================================================
--- csplugins/trunk/toronto/jm/performance-reporter/pom.xml     2012-10-30 
13:19:29 UTC (rev 30721)
+++ csplugins/trunk/toronto/jm/performance-reporter/pom.xml     2012-10-30 
14:30:03 UTC (rev 30722)
@@ -16,7 +16,7 @@
        <packaging>bundle</packaging>
        <name>${bundle.symbolicName}</name>
 
-       <version>1.0.0.beta1</version>
+       <version>1.0.0.beta2</version>
 
        <distributionManagement>
                <repository>
@@ -86,6 +86,11 @@
                </dependency>
                <dependency>
                        <groupId>org.cytoscape</groupId>
+                       <artifactId>io-api</artifactId>
+                       <version>${cytoscape.api.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
                        <artifactId>service-api</artifactId>
                        <version>${cytoscape.api.version}</version>
                </dependency>

Modified: 
csplugins/trunk/toronto/jm/performance-reporter/src/main/java/org/cytoscape/extras/performance/internal/GeneratePerformanceReportTaskFactory.java
===================================================================
--- 
csplugins/trunk/toronto/jm/performance-reporter/src/main/java/org/cytoscape/extras/performance/internal/GeneratePerformanceReportTaskFactory.java
   2012-10-30 13:19:29 UTC (rev 30721)
+++ 
csplugins/trunk/toronto/jm/performance-reporter/src/main/java/org/cytoscape/extras/performance/internal/GeneratePerformanceReportTaskFactory.java
   2012-10-30 14:30:03 UTC (rev 30722)
@@ -28,6 +28,7 @@
 import org.cytoscape.application.CyVersion;
 import org.cytoscape.diagnostics.PerformanceDetails;
 import org.cytoscape.diagnostics.SystemDetails;
+import org.cytoscape.io.util.StreamUtil;
 import org.cytoscape.work.AbstractTask;
 import org.cytoscape.work.TaskFactory;
 import org.cytoscape.work.TaskIterator;
@@ -50,11 +51,12 @@
                        public void run(TaskMonitor taskMonitor) throws 
Exception {
                                ServicePool pool = new ServicePool(context);
                                try {
+                                       StreamUtil streamUtil = 
pool.getService(StreamUtil.class);
                                        PerformanceDetails performanceDetails = 
pool.getService(PerformanceDetails.class);
                                        SystemDetails systemDetails = 
pool.getService(SystemDetails.class);
                                        String report = 
buildReport(systemDetails, performanceDetails);
                                        
-                                       JDialog dialog = createDialog(report);
+                                       JDialog dialog = createDialog(report, 
streamUtil);
                                        dialog.setLocationByPlatform(true);
                                        dialog.setSize(800, 600);
                                        dialog.setVisible(true);
@@ -66,7 +68,7 @@
                });
        }
        
-       JDialog createDialog(final String report) {
+       JDialog createDialog(final String report, final StreamUtil streamUtil) {
                final JDialog dialog = new JDialog();
                dialog.setTitle("Performance Report");
                
@@ -79,7 +81,7 @@
                sendButton.setEnabled(!reportSent);
                sendButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent event) {
-                               if (sendReport(report)) {
+                               if (sendReport(report, streamUtil)) {
                                        JOptionPane.showMessageDialog(dialog, 
"Thank you for sending us your report!  Your feedback will help us improve 
future versions of Cytoscape.", "Submit Report", 
JOptionPane.INFORMATION_MESSAGE);
                                        reportSent = true;
                                        sendButton.setEnabled(false);
@@ -112,10 +114,10 @@
                return dialog;
        }
 
-       protected boolean sendReport(String report) {
+       protected boolean sendReport(String report, StreamUtil streamUtil) {
                String version = getVersion();
                try {
-                       return sendReport(REPORT_HOST, version, report);
+                       return sendReport(REPORT_HOST, version, report, 
streamUtil);
                } catch (IOException e) {
                        e.printStackTrace();
                        return false;
@@ -135,9 +137,9 @@
                }
        }
 
-       boolean sendReport(String host, String version, String report) throws 
IOException {
+       boolean sendReport(String host, String version, String report, 
StreamUtil streamUtil) throws IOException {
                URL url = new URL(String.format("http://%s/log-performance/%s";, 
host, version));
-               HttpURLConnection connection = (HttpURLConnection) 
url.openConnection();
+               HttpURLConnection connection = (HttpURLConnection) 
streamUtil.getURLConnection(url);
                connection.setDoOutput(true);
                connection.setRequestMethod("PUT");
                PrintWriter writer = new 
PrintWriter(connection.getOutputStream());

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to