Permalink
Browse files

Add: support for wagon:upload goal by implementing

GitSiteWagon.put(source, destination)
  • Loading branch information...
rgladwell committed Sep 9, 2011
1 parent 7ef8d92 commit ba0571654b94e24083177321c695adfc455e00b4
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/main/java/org/kathrynhuxtable/maven/wagon/gitsite/GitSiteWagon.java
@@ -529,7 +529,7 @@ public void connect(Repository repository, AuthenticationInfo authenticationInfo
* @see org.apache.maven.wagon.Wagon#put(java.io.File, java.lang.String)
*/
public void put(File source, String destination) throws TransferFailedException {
- throw new TransferFailedException("Not currently supported: put");
+ putResource(source, destination);
}
/**
@@ -541,7 +541,11 @@ public void putDirectory(File sourceDirectory, String destinationDirectory) thro
throw new IllegalArgumentException("Source is not a directory: " + sourceDirectory);
}
- Resource target = new Resource(destinationDirectory);
+ putResource(sourceDirectory, destinationDirectory);
+ }
+
+ private void putResource(File sourceDirectory, String destinationDirectory) throws TransferFailedException {
+ Resource target = new Resource(destinationDirectory);
firePutInitiated(target, sourceDirectory);
@@ -601,7 +605,7 @@ public void putDirectory(File sourceDirectory, String destinationDirectory) thro
}
firePutCompleted(target, sourceDirectory);
- }
+ }
/**
* Check that the ScmResult was a successful operation

0 comments on commit ba05716

Please sign in to comment.