maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r485105 - /maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java
Date Sun, 10 Dec 2006 00:34:48 GMT
Author: joakime
Date: Sat Dec  9 16:34:47 2006
New Revision: 485105

URL: http://svn.apache.org/viewvc?view=rev&rev=485105
Log:
[WAGON-33] FileWagon#putDirectory() fails in HP-UX if destinationDirectory is "."
Patch not used.  New, safer, technique used (with comments).

Modified:
    maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java

Modified: maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java?view=diff&rev=485105&r1=485104&r2=485105
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java
Sat Dec  9 16:34:47 2006
@@ -118,7 +118,27 @@
     {
         File path = resolveDestinationPath( destinationDirectory );
 
-        path.mkdirs();
+        try
+        {
+            /* Done to address issue found in HP-UX with regards to "." directory references.
+             * Details found in ..
+             * WAGON-30 - wagon-file failed when used by maven-site-plugin
+             * WAGON-33 - FileWagon#putDirectory() fails in HP-UX if destinationDirectory
is "."
+             * http://www.nabble.com/With-maven-2.0.2-site%3Adeploy-doesn%27t-work-t934716.html
for details.
+             * 
+             * Using path.getCanonicalFile() ensures that the path is fully 
+             * resolved before an attempt to create it.
+             * 
+             * TODO: consider moving this to FileUtils.mkdirs()
+             */
+            File realFile = path.getCanonicalFile();
+            realFile.mkdirs();
+        }
+        catch ( IOException e )
+        {
+            // Fall back to standard way if getCanonicalFile() fails.
+            path.mkdirs();
+        }
  
         if ( !path.exists() || !path.isDirectory() )
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message