← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11532: Document, more logging during upload. Added java tmp dir to about page.

 

------------------------------------------------------------
revno: 11532
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-07-26 15:53:21 +0200
message:
  Document, more logging during upload. Added java tmp dir to about page.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/SaveDocumentAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm	2012-11-07 08:12:06 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm	2013-07-26 13:53:21 +0000
@@ -13,6 +13,7 @@
   <dt>$i18n.getString( "database_user" ):</dt><dd>$!info.user</dd>
   #if ( $currentUserIsSuper )
   <dt>$i18n.getString( "java_opts" ):</dt><dd>$!javaOpts</dd>
+  <dt>$i18n.getString( "java_tmp_dir" ):</dt><dd>$!javaIoTmpDir</dd>
   <dt>$i18n.getString( "java_version" ):</dt><dd>$systemProperties.get( "java.version" )</dd>
   <dt>$i18n.getString( "java_vendor" ):</dt><dd>$systemProperties.get( "java.vendor" )</dd>
   <dt>$i18n.getString( "os_name" ):</dt><dd>$systemProperties.get( "os.name" )</dd>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java	2013-05-02 11:23:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java	2013-07-26 13:53:21 +0000
@@ -126,6 +126,13 @@
     {
         return environmentVariable;
     }
+    
+    private String javaIoTmpDir;
+
+    public String getJavaIoTmpDir()
+    {
+        return javaIoTmpDir;
+    }
 
     private String externalDirectory;
 
@@ -262,6 +269,15 @@
             javaOpts = i18n.getString( "unknown" );
         }
         
+        try
+        {
+            javaIoTmpDir = System.getProperty( "java.io.tmpdir" );
+        }
+        catch ( SecurityException ex )
+        {
+            javaOpts = i18n.getString( "unknown" );
+        }
+        
         systemProperties = System.getProperties();
         
         currentUserIsSuper = currentUserService.currentUserIsSuper();

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2013-07-22 18:11:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2013-07-26 13:53:21 +0000
@@ -335,6 +335,7 @@
 last_name=Last name
 unknown=Unknown
 java_opts=Java Opts
+java_tmp_dir=Java temporary directory
 java_version=Java version
 java_vendor=Java vendor
 os_name=OS name

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/SaveDocumentAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/SaveDocumentAction.java	2013-04-30 11:25:21 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/SaveDocumentAction.java	2013-07-26 13:53:21 +0000
@@ -144,11 +144,13 @@
 
             File destination = locationManager.getFileForWriting( fileName, DocumentService.DIR );
 
+            log.info( "Destination: '" + destination.getAbsolutePath() + "'" );
+            
             boolean fileMoved = file.renameTo( destination );
 
             if ( !fileMoved )
             {
-                throw new RuntimeException( "File was not uploaded" );
+                throw new RuntimeException( "File could not be moved to: '" + destination.getAbsolutePath() + "'" );
             }
 
             url = fileName;