Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
UserInfoUIKeyboardInteractiveProxy |
|
| 1.0;1 |
1 | package org.apache.maven.wagon.providers.ssh.interactive; |
|
2 | ||
3 | /* |
|
4 | * Copyright 2001-2005 The Apache Software Foundation. |
|
5 | * |
|
6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | * you may not use this file except in compliance with the License. |
|
8 | * You may obtain a copy of the License at |
|
9 | * |
|
10 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | * |
|
12 | * Unless required by applicable law or agreed to in writing, software |
|
13 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | * See the License for the specific language governing permissions and |
|
16 | * limitations under the License. |
|
17 | */ |
|
18 | ||
19 | import com.jcraft.jsch.UIKeyboardInteractive; |
|
20 | import com.jcraft.jsch.UserInfo; |
|
21 | ||
22 | /** |
|
23 | * A proxy that let you merge a <code>UserInfo</code> and a |
|
24 | * <code>UIKeyboardInteractive</code> |
|
25 | * |
|
26 | * @author Juan F. Codagnone |
|
27 | * @since Sep 22, 2005 |
|
28 | */ |
|
29 | public class UserInfoUIKeyboardInteractiveProxy |
|
30 | implements UserInfo, UIKeyboardInteractive |
|
31 | { |
|
32 | private final UIKeyboardInteractive interactive; |
|
33 | ||
34 | private final UserInfo userInfo; |
|
35 | ||
36 | public UserInfoUIKeyboardInteractiveProxy( UserInfo userInfo, UIKeyboardInteractive interactive ) |
|
37 | 0 | { |
38 | 0 | this.userInfo = userInfo; |
39 | 0 | this.interactive = interactive; |
40 | 0 | } |
41 | ||
42 | /** |
|
43 | * @see com.jcraft.jsch.UIKeyboardInteractive#promptKeyboardInteractive(String, String, String, String[], boolean[]) |
|
44 | */ |
|
45 | public String[] promptKeyboardInteractive( String destination, String name, String instruction, String[] prompt, |
|
46 | boolean[] echo ) |
|
47 | { |
|
48 | 0 | return interactive.promptKeyboardInteractive( destination, name, instruction, prompt, echo ); |
49 | } |
|
50 | ||
51 | /** |
|
52 | * @see com.jcraft.jsch.UserInfo#getPassphrase() |
|
53 | */ |
|
54 | public String getPassphrase() |
|
55 | { |
|
56 | 0 | return userInfo.getPassphrase(); |
57 | } |
|
58 | ||
59 | /** |
|
60 | * @see com.jcraft.jsch.UserInfo#getPassword() |
|
61 | */ |
|
62 | public String getPassword() |
|
63 | { |
|
64 | 0 | return userInfo.getPassword(); |
65 | } |
|
66 | ||
67 | /** |
|
68 | * @see com.jcraft.jsch.UserInfo#promptPassword(String) |
|
69 | */ |
|
70 | public boolean promptPassword( String arg0 ) |
|
71 | { |
|
72 | 0 | return userInfo.promptPassword( arg0 ); |
73 | } |
|
74 | ||
75 | /** |
|
76 | * @see com.jcraft.jsch.UserInfo#promptPassphrase(String) |
|
77 | */ |
|
78 | public boolean promptPassphrase( String arg0 ) |
|
79 | { |
|
80 | 0 | return userInfo.promptPassphrase( arg0 ); |
81 | } |
|
82 | ||
83 | /** |
|
84 | * @see com.jcraft.jsch.UserInfo#promptYesNo(String) |
|
85 | */ |
|
86 | public boolean promptYesNo( String arg0 ) |
|
87 | { |
|
88 | 0 | return userInfo.promptYesNo( arg0 ); |
89 | } |
|
90 | ||
91 | /** |
|
92 | * @see com.jcraft.jsch.UserInfo#showMessage(String) |
|
93 | */ |
|
94 | public void showMessage( String arg0 ) |
|
95 | { |
|
96 | 0 | userInfo.showMessage( arg0 ); |
97 | 0 | } |
98 | ||
99 | } |