Class FtpRunAs


  • public class FtpRunAs
    extends Object
    RunAs for FTP.
    Author:
    Matija Obreza
    • Field Detail

      • LOG

        public static final org.slf4j.Logger LOG
        The Constant LOG.
    • Constructor Detail

      • FtpRunAs

        public FtpRunAs()
    • Method Detail

      • asFtpUser

        public static <R,​T extends Throwable> R asFtpUser​(FtpUser ftpUser,
                                                                FtpRunAs.NoArgMethod<R,​T> runnable)
                                                         throws T extends Throwable
        Run method as the ftp user. Switches Spring security context to FtpUser.user and back to what it was.
        Type Parameters:
        R - method return type
        T - exception type
        Parameters:
        ftpUser - the ftp user
        runnable - the code to execute as FTP user
        Returns:
        the result of runnable
        Throws:
        T - the exception
        T extends Throwable