1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2.provider.ftps;
18
19 import org.apache.commons.net.ftp.FTPClient;
20 import org.apache.commons.net.ftp.FTPSClient;
21 import org.apache.commons.vfs2.FileSystemException;
22 import org.apache.commons.vfs2.FileSystemOptions;
23 import org.apache.commons.vfs2.UserAuthenticationData;
24 import org.apache.commons.vfs2.provider.GenericFileName;
25 import org.apache.commons.vfs2.provider.ftp.FTPClientWrapper;
26 import org.apache.commons.vfs2.util.UserAuthenticatorUtils;
27
28
29
30
31
32
33
34
35
36
37 class FtpsClientWrapper extends FTPClientWrapper {
38
39 FtpsClientWrapper(final GenericFileName root, final FileSystemOptions fileSystemOptions)
40 throws FileSystemException {
41 super(root, fileSystemOptions);
42 }
43
44 @Override
45 protected FTPClient createClient(final GenericFileName rootName, final UserAuthenticationData authData)
46 throws FileSystemException {
47 return FtpsClientFactory.createConnection(rootName.getHostName(), rootName.getPort(),
48 UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME,
49 UserAuthenticatorUtils.toChar(rootName.getUserName())),
50 UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD,
51 UserAuthenticatorUtils.toChar(rootName.getPassword())),
52 rootName.getPath(), getFileSystemOptions());
53 }
54 }