← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3614: local vn - Fixed upload excel template files.

 

------------------------------------------------------------
revno: 3614
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-05-13 16:38:17 +0700
message:
  local vn - Fixed upload excel template files.
modified:
  local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportLocationManager.java
  local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ValidateUploadExcelFile.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 'local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportLocationManager.java'
--- local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportLocationManager.java	2011-03-28 07:23:41 +0000
+++ local/vn/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportLocationManager.java	2011-05-13 09:38:17 +0000
@@ -45,6 +45,8 @@
     private File REPORT;
 
     private File REPORT_TEMP;
+    
+    private File REPORT_TEMPLATE;
 
     // -------------------------------------------------------------------------
     // Dependency
@@ -124,14 +126,11 @@
             return null;
         }
 
-        File templateDirectory = new File( REPORT, pathConfig );
-
-        if ( !templateDirectory.exists() )
-        {
-            templateDirectory.mkdirs();
-        }
-
-        return templateDirectory;
+        REPORT_TEMPLATE = new File( REPORT, pathConfig );
+        
+        REPORT_TEMPLATE.mkdirs();
+
+        return REPORT_TEMPLATE;
     }
 
     public boolean isFileTypeSupported( String extension, String contentType )

=== modified file 'local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ValidateUploadExcelFile.java'
--- local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ValidateUploadExcelFile.java	2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ValidateUploadExcelFile.java	2011-05-13 09:38:17 +0000
@@ -156,13 +156,6 @@
 
         File output = new File( templateDirectoryConfig, uploadFileName );
 
-        if ( !output.canWrite() )
-        {
-            message = i18n.getString( "access_denied_to_file" );
-
-            return ERROR;
-        }
-
         if ( output.exists() )
         {
             message = i18n.getString( "override_confirm" );