AbstractWagon implements Wagon { @Override public final void putDirectory(File sourceDirectory, String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { File[] files = sourceDirectory.listFiles(); if (files != null) { for (File f : files) { put(f, destinationDirectory + "/" + f.getName()); } } } protected  AbstractWagon(boolean supportsDirectoryCopy); protected  AbstractWagon(boolean supportsDirectoryCopy, SessionListenerSupport sessionListenerSupport,
                            TransferListenerSupport transferListenerSupport); @Override final void addSessionListener(SessionListener sessionListener); @Override final boolean hasSessionListener(SessionListener sessionListener); @Override final void removeSessionListener(SessionListener sessionListener); @Override final void addTransferListener(TransferListener transferListener); @Override final boolean hasTransferListener(TransferListener transferListener); @Override final void removeTransferListener(TransferListener transferListener); @Override final Repository getRepository(); @Override final boolean isInteractive(); @Override final void setInteractive(boolean interactive); @Override final void connect(Repository source); @Override final void connect(Repository source, ProxyInfo proxyInfo); @Override final void connect(Repository source, AuthenticationInfo authenticationInfo); @Override final void connect(Repository source, ProxyInfoProvider proxyInfoProvider); @Override final void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo); @Override final void connect(Repository source, AuthenticationInfo authenticationInfo,
                              ProxyInfoProvider proxyInfoProvider); @Override final void disconnect(); @Override final void get(String resourceName, File destination); @Override final List<String> getFileList(String destinationDirectory); @Override final boolean getIfNewer(String resourceName, File destination, long timestamp); @Override final void openConnection(); @Override final void put(File source, String destination); @Override final void putDirectory(File sourceDirectory, String destinationDirectory); @Override final boolean resourceExists(String resourceName); @Override final boolean supportsDirectoryCopy(); @Override final int getReadTimeout(); @Override final void setReadTimeout(int readTimeout); @Override final int getTimeout(); @Override final void setTimeout(int timeout);  }
@Test public void putDirectory() throws IOException, TransferFailedException, ResourceDoesNotExistException, AuthorizationException { File directory = new File("target/test"); directory.mkdirs(); File file = new File(directory, "test.txt"); file.createNewFile(); this.wagon.putDirectory(directory, "foo"); verify(this.transferListenerSupport).fireTransferInitiated(new Resource("foo/test.txt"), TransferEvent.REQUEST_PUT); verify(this.transferListenerSupport).fireTransferStarted(new Resource("foo/test.txt"), TransferEvent.REQUEST_PUT); verify(this.wagon).putResource(eq(new File("target/test/test.txt")), eq("foo/test.txt"), any(TransferProgress.class)); verify(this.transferListenerSupport).fireTransferCompleted(new Resource("foo/test.txt"), TransferEvent.REQUEST_PUT); }