Clones the given Properties without the standard "user" or "password" entries. @param properties may be null @return a clone of the input without the standard "user" or "password" entries. @since 2.8.0
(final Properties properties)
| 113 | * @since 2.8.0 |
| 114 | */ |
| 115 | public static Properties cloneWithoutCredentials(final Properties properties) { |
| 116 | if (properties != null) { |
| 117 | final Properties temp = (Properties) properties.clone(); |
| 118 | temp.remove(Constants.KEY_USER); |
| 119 | temp.remove(Constants.KEY_PASSWORD); |
| 120 | return temp; |
| 121 | } |
| 122 | return properties; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Closes the given {@link AutoCloseable} and if an exception is caught, then calls {@code exceptionHandler}. |