You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by bf...@apache.org on 2014/08/04 10:13:58 UTC
svn commit: r1615497 - in /oodt/trunk/protocol/sftp: pom.xml
src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java
Author: bfoster
Date: Mon Aug 4 08:13:58 2014
New Revision: 1615497
URL: http://svn.apache.org/r1615497
Log:
Updates to SFTP protocol delete and resources ------ OODT-730
Modified:
oodt/trunk/protocol/sftp/pom.xml
oodt/trunk/protocol/sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java
Modified: oodt/trunk/protocol/sftp/pom.xml
URL: http://svn.apache.org/viewvc/oodt/trunk/protocol/sftp/pom.xml?rev=1615497&r1=1615496&r2=1615497&view=diff
==============================================================================
--- oodt/trunk/protocol/sftp/pom.xml (original)
+++ oodt/trunk/protocol/sftp/pom.xml Mon Aug 4 08:13:58 2014
@@ -50,6 +50,17 @@
</build>
</profile>
</profiles>
+ <build>
+ <resources>
+ <resource>
+ <targetPath>org/apache/oodt/cas/protocol/sftp</targetPath>
+ <directory>${basedir}/src/main/resources/policy</directory>
+ <includes>
+ <include>sftp-protocol-config.xml</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
<dependencies>
<dependency>
<groupId>org.apache.oodt</groupId>
Modified: oodt/trunk/protocol/sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java
URL: http://svn.apache.org/viewvc/oodt/trunk/protocol/sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java?rev=1615497&r1=1615496&r2=1615497&view=diff
==============================================================================
--- oodt/trunk/protocol/sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java (original)
+++ oodt/trunk/protocol/sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java Mon Aug 4 08:13:58 2014
@@ -194,7 +194,11 @@ public class JschSftpProtocol implements
public void delete(ProtocolFile file) throws ProtocolException {
try {
- sftpChannel.rm(file.getPath());
+ if (file.isDir()) {
+ sftpChannel.rmdir(file.getPath());
+ } else {
+ sftpChannel.rm(file.getPath());
+ }
} catch (Exception e) {
throw new ProtocolException("Failed to download file '" + file + "' : " + e.getMessage(), e);
}