You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wagon-commits@maven.apache.org by mi...@apache.org on 2004/06/30 19:19:45 UTC
cvs commit: maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon WagonUtils.java
michal 2004/06/30 10:19:45
Modified: wagon-api/src/main/java/org/apache/maven/wagon
WagonUtils.java
Log:
quick hack to access auth info which will allow us to deploy artifacts
Revision Changes Path
1.6 +34 -1 maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonUtils.java
Index: WagonUtils.java
===================================================================
RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonUtils.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WagonUtils.java 29 Jun 2004 18:14:28 -0000 1.5
+++ WagonUtils.java 30 Jun 2004 17:19:45 -0000 1.6
@@ -18,6 +18,7 @@
*/
import org.apache.maven.wagon.authorization.AuthorizationException;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
@@ -150,5 +151,37 @@
}
}
+
+ public static AuthenticationInfo getAuthInfo()
+ {
+ AuthenticationInfo authInfo = new AuthenticationInfo();
+
+ String userName = getUserName();
+
+ authInfo.setUserName( userName );
+
+ File privateKey = new File( System.getProperty( "user.home" ), "/.ssh/id_dsa" );
+
+ if ( privateKey.exists() )
+ {
+ authInfo.setPrivateKey( privateKey.getAbsolutePath() );
+
+ authInfo.setPassphrase( "" );
+ }
+
+ authInfo.setGroup( getUserName() );
+
+ return authInfo;
+ }
+
+
+ public static String getUserName()
+ {
+ String userName = System.getProperty( "user.name" );
+
+ return userName;
+ }
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-cvs-help@maven.apache.org