Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Contine the JENKINS-27289 ticket: update the getResources as well
  • Loading branch information
liorhson committed Jun 1, 2015
1 parent aa0d84a commit 40e7512
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions core/src/main/java/hudson/util/MaskingClassLoader.java
Expand Up @@ -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
Expand Down Expand Up @@ -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){
Expand Down

0 comments on commit 40e7512

Please sign in to comment.