Your browser does not support HTML5 local storage or you have disabled it. Some functionality on this site, including saving your privacy settings and offering you special discounts, uses local storage and may not work with local storage disabled. We recommend allowing the use of local storage in your browser. In some browsers, it is the same setting used for disabling cookies.


com.ssh.sft
Class AbstractPolicy

java.lang.Object
  extended bycom.ssh.sft.AbstractPolicy
All Implemented Interfaces:
Policies.All, Policies.Copy, Policies.CopyDir, Policies.Dir, Policies.MoveDir, Policies.Remove, Policies.RemoveDir

public class AbstractPolicy
extends Object
implements Policies.All

A default implementation for policies.


Constructor Summary
AbstractPolicy()
           
 
Method Summary
 voidcomplete(Location loc, SftException ex)
           
 booleancreateDir(Location dir)
           
 booleanenterDir(Directory dir)
          Invoked when a directory is about to be entered and its contents are to be processed.
 CharConversionfromSource(File src)
          Invoked to specify the type of CharConversion to use to read from the given src file.
 voidleaveDir(Directory dir)
          Invoked when the recursive processing of a directory has finished.
 voidlist(File file)
           
 booleanoverwrite(File src, File dst)
          Invoked when an existing file is about to be overwritten.
 booleanremove(File file)
          Invoked when a file is about to be removed.
 booleanremoveDir(Directory dir)
           
 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.
 voidreport(File File, int errorCode, String msg)
          Invoked when an informative message related to the operation 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPolicy

public AbstractPolicy()
Method Detail

start

public boolean start(File src,
                     Location dst)
Description copied from interface: Policies.Copy
Invoked when a file copy operation from src to dst is started.

Specified by:
start in interface Policies.Copy
Parameters:
src - the path to copy from
dst - the path to copy to
Returns:
true if the operation may proceed, false otherwise

overwrite

public boolean overwrite(File src,
                         File dst)
Description copied from interface: Policies.Copy
Invoked when an existing file is about to be overwritten.

Specified by:
overwrite in interface Policies.Copy
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

fromSource

public CharConversion fromSource(File src)
Description copied from interface: Policies.Copy
Invoked to specify the type of CharConversion to use to read from the given src file.

Specified by:
fromSource in interface Policies.Copy
Parameters:
src - File to specify the type of newlines to use.
Returns:
The type of newlines to use.

toDest

public CharConversion toDest(Location dst)
Description copied from interface: Policies.Copy
Invoked to specify the type of CharConversion to use to write to the given destination

Specified by:
toDest in interface Policies.Copy
Parameters:
dst - Location to specify the type of newlines to use.
Returns:
The type of newlines to use.

remove

public boolean remove(File file)
Description copied from interface: Policies.Remove
Invoked when a file is about to be removed.

Specified by:
remove in interface Policies.Remove
Parameters:
file - The file to be removed
Returns:
true if the file may be removed, false otherwise

enterDir

public boolean enterDir(Directory dir)
Description copied from interface: Policies.Dir
Invoked when a directory is about to be entered and its contents are to be processed.

Specified by:
enterDir in interface Policies.Dir
Parameters:
dir - the directory to be entered
Returns:
true if the directory should be entered, false otherwise

leaveDir

public void leaveDir(Directory dir)
Description copied from interface: Policies.Dir
Invoked when the recursive processing of a directory has finished. This is only a notification.

Specified by:
leaveDir in interface Policies.Dir
Parameters:
dir - the directory that is left

list

public void list(File file)
Specified by:
list in interface Policies.Dir

complete

public void complete(Location loc,
                     SftException ex)
              throws SftException
Specified by:
complete in interface Policies.Dir
Throws:
SftException

createDir

public boolean createDir(Location dir)
Specified by:
createDir in interface Policies.CopyDir

removeDir

public boolean removeDir(Directory dir)
Specified by:
removeDir in interface Policies.RemoveDir

report

public void report(File srcFile,
                   File dstFile,
                   int errorCode,
                   String msg)
Description copied from interface: Policies.Copy
Invoked when an informative message related to the copy wants to be passed to the application.

Specified by:
report in interface Policies.Copy
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.

report

public void report(File File,
                   int errorCode,
                   String msg)
Description copied from interface: Policies.Remove
Invoked when an informative message related to the operation wants to be passed to the application.

Specified by:
report in interface Policies.Remove
Parameters:
File - the path to the file.
errorCode - the SftException.getErrorCode() value.
msg - message to be passed to the application.


===AUTO_SCHEMA_MARKUP===