Class FtpRunAs
- java.lang.Object
-
- org.genesys.filerepository.service.ftp.FtpRunAs
-
public class FtpRunAs extends Object
RunAs for FTP.- Author:
- Matija Obreza
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFtpRunAs.NoArgMethod<R,T extends Throwable>NoArgMethod.
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOGThe Constant LOG.
-
Constructor Summary
Constructors Constructor Description FtpRunAs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R,T extends Throwable>
RasFtpUser(FtpUser ftpUser, FtpRunAs.NoArgMethod<R,T> runnable)Run method as the ftp user.
-
-
-
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 toFtpUser.userand back to what it was.- Type Parameters:
R- method return typeT- exception type- Parameters:
ftpUser- the ftp userrunnable- the code to execute as FTP user- Returns:
- the result of runnable
- Throws:
T- the exceptionT extends Throwable
-
-