Your browser does not allow storing cookies. We recommend enabling them.


com.ssh.sft
Interface Policies.Copy

All Known Subinterfaces:
Policies.All, Policies.CopyDir, Policies.Move, Policies.MoveDir
All Known Implementing Classes:
AbstractPolicy
Enclosing interface:
Policies

public static interface Policies.Copy

The policy interface for copying files.


Method Summary
 CharConversionfromSource(File src)
          Invoked to specify the type of CharConversion to use to read from the given src file.
 booleanoverwrite(File src, File dst)
          Invoked when an existing file is about to be overwritten.
 voidreport(File srcFile, File dstFile, int errorCode, String msg)
          Invoked when an informative message related to the copy wants to be passed to the application.
 booleanstart(File src, Location dst)
          Invoked when a file copy operation from src to dst is started.
 CharConversiontoDest(Location dst)
          Invoked to specify the type of CharConversion to use to write to the given destination
 

Method Detail

start

public boolean start(File src,
                     Location dst)
              throws AbortedException
Invoked when a file copy operation from src to dst is started.

Parameters:
src - the path to copy from
dst - the path to copy to
Returns:
true if the operation may proceed, false otherwise
Throws:
AbortedException - if the entire ongoing operation should be aborted

overwrite

public boolean overwrite(File src,
                         File dst)
                  throws AbortedException
Invoked when an existing file is about to be overwritten.

Parameters:
src - the path to the file that is about to overwrite
dst - the path to the file that is about to be overwritten
Returns:
true if overwriting is allowed, false otherwise
Throws:
AbortedException - if the entire ongoing operation should be aborted

fromSource

public CharConversion fromSource(File src)
                          throws AbortedException
Invoked to specify the type of CharConversion to use to read from the given src file.

Parameters:
src - File to specify the type of newlines to use.
Returns:
The type of newlines to use.
Throws:
AbortedException

toDest

public CharConversion toDest(Location dst)
                      throws AbortedException
Invoked to specify the type of CharConversion to use to write to the given destination

Parameters:
dst - Location to specify the type of newlines to use.
Returns:
The type of newlines to use.
Throws:
AbortedException

report

public void report(File srcFile,
                   File dstFile,
                   int errorCode,
                   String msg)
            throws AbortedException
Invoked when an informative message related to the copy wants to be passed to the application.

Parameters:
srcFile - the path to the source file.
dstFile - the path to the destination file.
errorCode - the SftException.getErrorCode() value. *
msg - message to be passed to the application.
Throws:
AbortedException



 

 
Highlights from the SSH.COM blog:

  • Cryptomining with the SSH protocol: what big enterprises need to know about it

    Cryptomining malware is primarily thought of as targeting desktops and laptops and is used to hijack system resources to mine cryptocurrency.
    Read more
  • SLAM the door shut on traditional privileged access management

    Did you know that something as trivial-sounding as granting access for your developers or third parties to a product development environment can throw a gorilla-sized monkey wrench into your operations and productivity?
    Read more
  • We broke the IT security perimeter

    Everyone understands the concept of a security perimeter. You only gain access if you are identified and authorized to do so.
    Read more