incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r1172454 - in /incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator: ODFFileValidator.java ODFPackageValidator.java ODFStreamValidator.java ODFSubPackageValidator.java
Date Mon, 19 Sep 2011 05:38:02 GMT
Author: devinhan
Date: Mon Sep 19 05:38:02 2011
New Revision: 1172454

URL: http://svn.apache.org/viewvc?rev=1172454&view=rev
Log:
changeset:   23:33759f599184
user:        Michael Stahl <mst@openoffice.org>
date:        Tue Nov 23 14:48:17 2010 +0100
fix log messages for subdocuments: sub directory was printed twice

Modified:
    incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFFileValidator.java
    incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFPackageValidator.java
    incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFStreamValidator.java
    incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFSubPackageValidator.java

Modified: incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFFileValidator.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFFileValidator.java?rev=1172454&r1=1172453&r2=1172454&view=diff
==============================================================================
--- incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFFileValidator.java (original)
+++ incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFFileValidator.java Mon
Sep 19 05:38:02 2011
@@ -49,6 +49,12 @@ public class ODFFileValidator extends OD
         return m_aFile.getAbsolutePath();
     }
 
+    @Override
+    String getDocumentPath()
+    {
+        return ""; // this is the root document
+    }
+
     protected OdfPackage getPackage(ErrorHandler handler) throws Exception
     {
         return OdfPackage.loadPackage(m_aFile, handler);

Modified: incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFPackageValidator.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFPackageValidator.java?rev=1172454&r1=1172453&r2=1172454&view=diff
==============================================================================
--- incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFPackageValidator.java
(original)
+++ incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFPackageValidator.java
Mon Sep 19 05:38:02 2011
@@ -71,18 +71,20 @@ public abstract class ODFPackageValidato
         m_aConfigVersion = aVersion;
         m_aResult = new ODFValidationResult( aVersion, eMode );
     }
-    
-       
+
 
     abstract String getLoggerName();
-    
+
+    abstract String getDocumentPath();
+
     abstract OdfPackage getPackage( Logger aLogger );
-    
+
     abstract String getStreamName( String aEntry );
-    
+
     public boolean validate(PrintStream aOut) throws ODFValidatorException
     {
-        Logger aLogger = new Logger( getLoggerName(), "", aOut, m_nLogLevel);
+        Logger aLogger =
+            new Logger( getLoggerName(), getDocumentPath(), aOut, m_nLogLevel);
 
         boolean bHasErrors = false;
 

Modified: incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFStreamValidator.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFStreamValidator.java?rev=1172454&r1=1172453&r2=1172454&view=diff
==============================================================================
--- incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFStreamValidator.java
(original)
+++ incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFStreamValidator.java
Mon Sep 19 05:38:02 2011
@@ -59,4 +59,10 @@ public class ODFStreamValidator extends 
         return m_aBaseURI;
     }
 
+    @Override
+    String getDocumentPath()
+    {
+        return ""; // this is the root document
+    }
+
 };

Modified: incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFSubPackageValidator.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFSubPackageValidator.java?rev=1172454&r1=1172453&r2=1172454&view=diff
==============================================================================
--- incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFSubPackageValidator.java
(original)
+++ incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/ODFSubPackageValidator.java
Mon Sep 19 05:38:02 2011
@@ -28,6 +28,7 @@ import org.odftoolkit.odfdom.pkg.OdfPack
 public class ODFSubPackageValidator extends ODFPackageValidator {
 
     private OdfPackage m_aPkg = null;
+    // this is the URI of the root package, not this subpackage!
     private String m_aBaseURI = null;
     private String m_aSubEntryName = null;
 
@@ -38,7 +39,7 @@ public class ODFSubPackageValidator exte
     {
         super( nLogLevel, eMode, aVersion, aFilter, aValidatorProvider);
         m_aPkg = aPkg;
-        m_aBaseURI = aBaseURI + "/" + aSubEntryName;
+        m_aBaseURI = aBaseURI;
         m_aSubEntryName = aSubEntryName;
         m_aResult.setMediaType(aMediaType);
         if( aFilter != null )
@@ -50,6 +51,11 @@ public class ODFSubPackageValidator exte
         return m_aBaseURI;
     }
 
+    @Override
+    String getDocumentPath() {
+        return m_aSubEntryName;
+    }
+
     OdfPackage getPackage( Logger aLogger ) 
     {
         return m_aPkg;



Mime
View raw message