Skip to content

Commit

Permalink
Add: support for wagon:upload goal by implementing
Browse files Browse the repository at this point in the history
GitSiteWagon.put(source, destination)
  • Loading branch information
rgladwell committed Sep 9, 2011
1 parent 7ef8d92 commit ba05716
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -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);
}

/**
Expand All @@ -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);

Expand Down Expand Up @@ -601,7 +605,7 @@ public void putDirectory(File sourceDirectory, String destinationDirectory) thro
}

firePutCompleted(target, sourceDirectory);
}
}

/**
* Check that the ScmResult was a successful operation
Expand Down

0 comments on commit ba05716

Please sign in to comment.