Skip to content
Permalink
Browse files
Contine the JENKINS-27289 ticket: update the getResources as well
(cherry picked from commit 40e7512)
  • Loading branch information
liorhson authored and olivergondza committed Jul 7, 2015
1 parent 119fcbb commit 0fcb58813b78cf698726a4987e8edcedea130acd
Showing with 12 additions and 4 deletions.
  1. +12 −4 core/src/main/java/hudson/util/MaskingClassLoader.java
@@ -23,11 +23,9 @@
*/
package hudson.util;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.*;

/**
* {@link ClassLoader} that masks a specified set of classes
@@ -82,6 +80,16 @@ public synchronized URL getResource(String name) {
return super.getResource(name);
}

@Override
public Enumeration<URL> getResources(String name) throws IOException {
for (String mask : masksResources) {
if(name.startsWith(mask))
return null;
}

return super.getResources(name);
}

public synchronized void add(String prefix) {
masksClasses.add(prefix);
if(prefix !=null){

0 comments on commit 0fcb588

Please sign in to comment.