Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
NullInteractiveUserInfo |
|
| 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 org.apache.maven.wagon.providers.ssh.interactive.InteractiveUserInfo; |
|
20 | ||
21 | /** |
|
22 | * Dummy Implementation for <code>InteractiveUserInfo</code>, nice for |
|
23 | * non-Interactive environments |
|
24 | * |
|
25 | * @author Juan F. Codagnone |
|
26 | * @since Sep 12, 2005 |
|
27 | * @see org.apache.maven.wagon.providers.ssh.interactive.InteractiveUserInfo |
|
28 | */ |
|
29 | public class NullInteractiveUserInfo |
|
30 | implements InteractiveUserInfo |
|
31 | { |
|
32 | private final boolean promptYesNoResult; |
|
33 | ||
34 | /** @see #NullInteractiveUserInfo(boolean) */ |
|
35 | public NullInteractiveUserInfo() |
|
36 | { |
|
37 | 0 | this( false ); // the safest value |
38 | 0 | } |
39 | ||
40 | /** |
|
41 | * Creates a <code>NullInteractiveUserInfo</code> with a hardcoded |
|
42 | * prompYesNo result |
|
43 | * |
|
44 | * @param promptYesNoResult the hardcoded result |
|
45 | */ |
|
46 | public NullInteractiveUserInfo( final boolean promptYesNoResult ) |
|
47 | 0 | { |
48 | 0 | this.promptYesNoResult = promptYesNoResult; |
49 | 0 | } |
50 | ||
51 | /** @see InteractiveUserInfo#promptYesNo(java.lang.String) */ |
|
52 | public boolean promptYesNo( final String message ) |
|
53 | { |
|
54 | 0 | return promptYesNoResult; |
55 | } |
|
56 | ||
57 | /** @see InteractiveUserInfo#showMessage(java.lang.String) */ |
|
58 | public void showMessage( final String message ) |
|
59 | { |
|
60 | // nothing to do |
|
61 | 0 | } |
62 | ||
63 | public String promptPassword( String message ) |
|
64 | { |
|
65 | 0 | return null; |
66 | } |
|
67 | ||
68 | public String promptPassphrase( String message ) |
|
69 | { |
|
70 | 0 | return null; |
71 | } |
|
72 | } |