db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1005456 - /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java
Date Thu, 07 Oct 2010 14:11:28 GMT
Author: tfischer
Date: Thu Oct  7 14:11:28 2010
New Revision: 1005456

URL: http://svn.apache.org/viewvc?rev=1005456&view=rev
Log:
Try to fix problem with .. in resource pathnames in unix for loading xsd files

Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java?rev=1005456&r1=1005455&r2=1005456&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java
Thu Oct  7 14:11:28 2010
@@ -23,6 +23,7 @@ import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -131,13 +132,23 @@ public class DirectoryConfigurationProvi
                 String description)
             throws ConfigurationException
     {
-        File file;
+        File file = null;
+        try
         {
             File configDir =  new File(
                     projectPaths.getConfigurationPath(),
                     directory);
 
             file = new File(configDir, name);
+            // use canonical file to resolve . and .. directories
+            file = file.getCanonicalFile();
+        }
+        catch (IOException e)
+        {
+            throw new ConfigurationException("Canonical name for "
+                    + description + file
+                    + " could not be calculated",
+                e);
         }
 
         InputStream inputStream;
@@ -149,7 +160,8 @@ public class DirectoryConfigurationProvi
         {
             throw new ConfigurationException(description + " file "
                     + file.getAbsolutePath()
-                    + " not found");
+                    + " not found",
+                e);
         }
         BufferedInputStream bis = new BufferedInputStream(inputStream);
         if (log.isDebugEnabled())



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message