Skip to content

Commit

Permalink
Access base directly
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1655127 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jan 27, 2015
1 parent 12e4fff commit 5611409
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
public abstract class AbstractArchiveResource extends AbstractResource {

private final AbstractArchiveResourceSet archiveResourceSet;
private final String base;
private final String baseUrl;
private final JarEntry resource;
private final String codeBaseUrl;
Expand All @@ -37,11 +36,9 @@ public abstract class AbstractArchiveResource extends AbstractResource {
private Certificate[] certificates;

protected AbstractArchiveResource(AbstractArchiveResourceSet archiveResourceSet,
String webAppPath, String base, String baseUrl, JarEntry jarEntry,
String codeBaseUrl) {
String webAppPath, String baseUrl, JarEntry jarEntry, String codeBaseUrl) {
super(archiveResourceSet.getRoot(), webAppPath);
this.archiveResourceSet = archiveResourceSet;
this.base = base;
this.baseUrl = baseUrl;
this.resource = jarEntry;
this.codeBaseUrl = codeBaseUrl;
Expand All @@ -65,7 +62,7 @@ protected AbstractArchiveResource(AbstractArchiveResourceSet archiveResourceSet,
}

protected final String getBase() {
return base;
return archiveResourceSet.getBase();
}

protected final String getBaseUrl() {
Expand Down
5 changes: 2 additions & 3 deletions java/org/apache/catalina/webresources/JarResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ public class JarResource extends AbstractArchiveResource {
private static final Log log = LogFactory.getLog(JarResource.class);

public JarResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath,
String base, String baseUrl, JarEntry jarEntry) {
super(archiveResourceSet, webAppPath, base, "jar:" + baseUrl, jarEntry,
baseUrl);
String baseUrl, JarEntry jarEntry) {
super(archiveResourceSet, webAppPath, "jar:" + baseUrl, jarEntry, baseUrl);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/catalina/webresources/JarResourceSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public JarResourceSet(WebResourceRoot root, String webAppMount, String base,
@Override
protected WebResource createArchiveResource(JarEntry jarEntry,
String webAppPath, Manifest manifest) {
return new JarResource(this, webAppPath, getBase(), getBaseUrlString(), jarEntry);
return new JarResource(this, webAppPath, getBaseUrlString(), jarEntry);
}

//-------------------------------------------------------- Lifecycle methods
Expand Down
4 changes: 2 additions & 2 deletions java/org/apache/catalina/webresources/JarWarResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class JarWarResource extends AbstractArchiveResource {
private final String archivePath;

public JarWarResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath,
String base, String baseUrl, JarEntry jarEntry, String archivePath) {
super(archiveResourceSet, webAppPath, base, "jar:war:" + baseUrl + "^/" + archivePath,
String baseUrl, JarEntry jarEntry, String archivePath) {
super(archiveResourceSet, webAppPath, "jar:war:" + baseUrl + "^/" + archivePath,
jarEntry, "jar:" + baseUrl + "!/" + archivePath);
this.archivePath = archivePath;
}
Expand Down
3 changes: 1 addition & 2 deletions java/org/apache/catalina/webresources/JarWarResourceSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public JarWarResourceSet(WebResourceRoot root, String webAppMount,
@Override
protected WebResource createArchiveResource(JarEntry jarEntry,
String webAppPath, Manifest manifest) {
return new JarWarResource(this, webAppPath, getBase(), getBaseUrlString(),
jarEntry, archivePath);
return new JarWarResource(this, webAppPath, getBaseUrlString(), jarEntry, archivePath);
}

//-------------------------------------------------------- Lifecycle methods
Expand Down

0 comments on commit 5611409

Please sign in to comment.