[
https://issues.apache.org/jira/browse/KNOX-1820?focusedWorklogId=213093&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-213093
]
ASF GitHub Bot logged work on KNOX-1820:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Mar/19 13:17
Start Date: 14/Mar/19 13:17
Worklog Time Spent: 10m
Work Description: rlevas commented on pull request #72: KNOX-1820 -
Cleanup KeystoreService implementations and add unit tests
URL: https://github.com/apache/knox/pull/72#discussion_r265562283
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
##########
@@ -442,23 +450,24 @@ public String getKeystorePath() {
* <p>
* if <code>failIfNotAccessible</code> is <code>true</code>, then the path
to the keystore file
* (keystorePath) is validated such that it exists, is a file and can be
read by the process. If
- * any of these checks fail, a {@link KeystoreServiceException} is thrown in
dicatating the exact
+ * any of these checks fail, a {@link KeystoreServiceException} is thrown in
dictating the exact
* reason.
* <p>
* Before the keystore file is loaded, the service's read lock is locked to
prevent concurrent
* reads on the file.
*
* @param keystorePath the path to the keystore file
* @param keystoreType the type of keystore file
- * @param alias the alias for the password to the keystore
file (see {@link #getKeystorePassword(String)})
+ * @param alias the alias for the password to the keystore
file (see {@link #getKeyStorePassword(String)})
* @param failIfNotAccessible <code>true</code> to ensure the keystore file
exists and is readable; <code>false</code> to not check
* @return a {@link KeyStore}, or <code>null</code> if the requested
keystore cannot be created
* @throws KeystoreServiceException if an error occurs loading the keystore
file
*/
private KeyStore getKeystore(Path keystorePath, String keystoreType, String
alias, boolean failIfNotAccessible) throws KeystoreServiceException {
- File keystoreFile = keystorePath.toFile();
if (failIfNotAccessible) {
+ File keystoreFile = keystorePath.toFile();
Review comment:
I though about switching to `Files.exists(keystorePath)`, but the code
looked more cumbersome. I can change to make it all consistent with the nio
package.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 213093)
Time Spent: 1h 20m (was: 1h 10m)
> Cleanup KeystoreService implementations and add unit tests
> ----------------------------------------------------------
>
> Key: KNOX-1820
> URL: https://issues.apache.org/jira/browse/KNOX-1820
> Project: Apache Knox
> Issue Type: Improvement
> Components: Server
> Reporter: Robert Levas
> Assignee: Robert Levas
> Priority: Minor
> Labels: cleanup
> Fix For: 1.3.0
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> {{org.apache.knox.gateway.services.security.impl.BaseKeystoreService}} should
> be an abstract class extended by
> {{org.apache.knox.gateway.services.security.impl.CMFKeystoreService}} and
> {{DefaultKeystoreService}.
> Unit test for these classes are missing and should be added.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)