Skip to content

Commit adbdc0f

Browse files
Address Francesco's review
1 parent 784734f commit adbdc0f

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/main/java/org/italiangrid/voms/store/impl/DefaultVOMSTrustStore.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ public class DefaultVOMSTrustStore implements VOMSTrustStore {
6363
* The list of local trusted directories that is searched for trust information (certs or LSC
6464
* files)
6565
**/
66-
protected final List<String> localTrustedDirs;
66+
private final List<String> localTrustedDirs;
6767

6868
/** Map of local parsed AA certificates keyed by certificate subject hash **/
69-
protected Map<String, X509Certificate> localAACertificatesByHash =
69+
private Map<String, X509Certificate> localAACertificatesByHash =
7070
new HashMap<String, X509Certificate>();
7171

7272
/** The set of local parsed LSC information keyed by VO **/
73-
protected Map<String, Set<LSCInfo>> localLSCInfo = new HashMap<String, Set<LSCInfo>>();
73+
private Map<String, Set<LSCInfo>> localLSCInfo = new HashMap<String, Set<LSCInfo>>();
7474

7575
/**
7676
* The trust store status listener that will be notified of changes in this trust store
7777
**/
78-
protected VOMSTrustStoreStatusListener listener;
78+
private VOMSTrustStoreStatusListener listener;
7979

8080
/** The read/write lock that implements thread safety for this store **/
8181
protected final ReadWriteLock rwLock = new ReentrantReadWriteLock();
@@ -89,14 +89,14 @@ public class DefaultVOMSTrustStore implements VOMSTrustStore {
8989
/** A lock to guard the setting of the status listener **/
9090
protected final Object listenerLock = new Object();
9191

92-
protected final List<String> voName;
92+
private final List<String> voNames;
9393

9494
/**
9595
* Builds a list of trusted directories containing only {@link #DEFAULT_VOMS_DIR}.
9696
*
9797
* @return a list of default trusted directory containing the {@link #DEFAULT_VOMS_DIR}
9898
**/
99-
public static List<String> buildDefaultTrustedDirs() {
99+
protected static List<String> buildDefaultTrustedDirs() {
100100

101101
List<String> tDirs = new ArrayList<String>();
102102
tDirs.add(DEFAULT_VOMS_DIR);
@@ -115,16 +115,17 @@ public DefaultVOMSTrustStore(List<String> localTrustDirs, VOMSTrustStoreStatusLi
115115
this(localTrustDirs, null, listener);
116116
}
117117

118-
public DefaultVOMSTrustStore(List<String> localTrustDirs, List<String> voName,
118+
public DefaultVOMSTrustStore(List<String> localTrustDirs, List<String> voNames,
119119
VOMSTrustStoreStatusListener listener) {
120120

121-
if (localTrustDirs == null)
121+
if (localTrustDirs == null) {
122122
throw new IllegalArgumentException(
123123
"Please provide a non-null list of local trust directories!");
124+
}
124125

125126
this.localTrustedDirs = localTrustDirs;
126127
this.listener = listener;
127-
this.voName = voName;
128+
this.voNames = voNames;
128129
loadTrustInformation();
129130
}
130131

@@ -263,7 +264,7 @@ private void loadCertificateFromFile(File file) {
263264
*
264265
* @param directory
265266
*/
266-
protected void loadLSCFromDirectory(File directory) {
267+
private void loadLSCFromDirectory(File directory) {
267268

268269
directorySanityChecks(directory);
269270

@@ -340,7 +341,7 @@ private void certificateFileSanityChecks(File certFile) {
340341
*
341342
* @param directory
342343
*/
343-
protected void directorySanityChecks(File directory) {
344+
private void directorySanityChecks(File directory) {
344345

345346
if (!directory.exists())
346347
throw new VOMSError("Local trust directory does not exists:" + directory.getAbsolutePath());
@@ -398,11 +399,10 @@ public boolean accept(File pathname) {
398399

399400
for (File voDir : voDirs) {
400401

401-
if (voName != null && !voName.contains(voDir.getName()))
402-
continue;
403-
404-
loadLSCFromDirectory(voDir);
405-
loadCertificatesFromDirectory(voDir);
402+
if (voNames == null || voNames.contains(voDir.getName())) {
403+
loadLSCFromDirectory(voDir);
404+
loadCertificatesFromDirectory(voDir);
405+
}
406406
}
407407
}
408408

0 commit comments

Comments
 (0)