org.mule.transport.sftp
Class SftpUtil

java.lang.Object
  extended by org.mule.transport.sftp.SftpUtil

public class SftpUtil
extends Object

Contains reusable methods not directly related to usage of the jsch sftp library (they can be found in the class SftpClient).

Author:
Magnus Larsson

Constructor Summary
SftpUtil(ImmutableEndpoint endpoint)
           
 
Method Summary
 void cleanupTempDir(SftpClient sftpClient, String transferFileName, String tempDir)
           
 void copyStreamToFile(InputStream input, File destination)
          Should be moved to a util class that is not based on an endpoint...
 String createUniqueSuffix(String filename)
           
 void cwdToTempDirOnOutbound(SftpClient sftpClient, String endpointDir)
          Changes the directory to the temp-dir on the outbound endpoint.
 String getArchiveDir()
           
 String getArchiveTempReceivingDir()
           
 String getArchiveTempSendingDir()
           
 String getDuplicateHandling()
           
 String getIdentityFile()
           
 String getPassphrase()
           
 long getSizeCheckWaitTime()
           
 String getTempDirInbound()
           
 String getTempDirOutbound()
           
 boolean isKeepFileOnError()
           
 boolean isUseTempDirInbound()
           
 boolean isUseTempDirOutbound()
           
 boolean isUseTempFileTimestampSuffix()
           
 void setErrorOccurredOnInputStream(InputStream inputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SftpUtil

public SftpUtil(ImmutableEndpoint endpoint)
Method Detail

createUniqueSuffix

public String createUniqueSuffix(String filename)

getTempDirInbound

public String getTempDirInbound()

isUseTempDirInbound

public boolean isUseTempDirInbound()

getTempDirOutbound

public String getTempDirOutbound()

isUseTempDirOutbound

public boolean isUseTempDirOutbound()

cleanupTempDir

public void cleanupTempDir(SftpClient sftpClient,
                           String transferFileName,
                           String tempDir)

getSizeCheckWaitTime

public long getSizeCheckWaitTime()

getArchiveDir

public String getArchiveDir()

getArchiveTempReceivingDir

public String getArchiveTempReceivingDir()

getArchiveTempSendingDir

public String getArchiveTempSendingDir()

isUseTempFileTimestampSuffix

public boolean isUseTempFileTimestampSuffix()

getDuplicateHandling

public String getDuplicateHandling()

getIdentityFile

public String getIdentityFile()

getPassphrase

public String getPassphrase()

cwdToTempDirOnOutbound

public void cwdToTempDirOnOutbound(SftpClient sftpClient,
                                   String endpointDir)
                            throws IOException
Changes the directory to the temp-dir on the outbound endpoint. Will create the directory if it not already exists.

Note, this method is synchronized because it in rare cases can be called from two threads at the same time and thus cause an error.

Parameters:
sftpClient -
endpointDir -
Throws:
IOException

isKeepFileOnError

public boolean isKeepFileOnError()

copyStreamToFile

public void copyStreamToFile(InputStream input,
                             File destination)
                      throws IOException
Should be moved to a util class that is not based on an endpoint... TODO: why is this method synchronized?

Parameters:
input -
destination -
Throws:
IOException

setErrorOccurredOnInputStream

public void setErrorOccurredOnInputStream(InputStream inputStream)


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.