code: static protected void recursiveDelete(MuleContext muleContext, SftpClient sftpClient, String endpointName, String relativePath) throws IOException {
  		EndpointURI endpointURI = getImmutableEndpoint(muleContext, endpointName).getEndpointURI();
  		String path = endpointURI.getPath() + relativePath;
  
  		try {
  			// Ensure that we can delete the current directory and the below
  			// directories (if write is not permitted then delete is either)
  			sftpClient.chmod(path, 00700);
  
  			sftpClient.changeWorkingDirectory(sftpClient.getAbsolutePath(path));
  
  			// Delete all sub-directories
  			String[] directories = sftpClient.listDirectories();
  			for (String directory : directories) {
  				recursiveDelete(muleContext, sftpClient, endpointName,
  						relativePath + "/" + directory);
  			}
  
  			// Needs to change the directory back after the recursiveDelete
  			sftpClient.changeWorkingDirectory(sftpClient.getAbsolutePath(path));
  
  			// Delete all files
  			String[] files = sftpClient.listFiles();
  			for (String file : files) {
  				sftpClient.deleteFile(file);
  			}
  
  			// Delete the directory
  			try {
  				sftpClient.deleteDirectory(path);
  			} catch (Exception e) {
  				if (logger.isDebugEnabled())
  					logger.debug("Failed delete directory " + path, e);
  			}
  
  		} catch (Exception e) {
  			if (logger.isDebugEnabled())
  				logger.debug("Failed to recursivly delete directory " + path, e);
  		}
  	}
docs: Deletes a directory with all its files and sub-directories. The reason it
  do a "chmod 700" before the delete is that some tests changes the
  permission, and thus we have to restore the right to delete it...
  
  @param muleClient
  @param endpointName
  @param relativePath
  @throws IOException