Your browser does not allow this site to store cookies and other data. Some functionality on this site may not work without them. See Privacy Policy for details on how we would use cookies.


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


===AUTO_SCHEMA_MARKUP===