|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2012-2015 the original author or authors. |
|
|
|
* Copyright 2012-2017 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -83,15 +83,21 @@ public abstract class AbstractEmbeddedServletContainerFactory |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private File getExplodedWarFileDocumentRoot() { |
|
|
|
private File getExplodedWarFileDocumentRoot() { |
|
|
|
File file = getCodeSourceArchive(); |
|
|
|
return getExplodedWarFileDocumentRoot(getCodeSourceArchive()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File getExplodedWarFileDocumentRoot(File codeSourceFile) { |
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
this.logger.debug("Code archive: " + file); |
|
|
|
this.logger.debug("Code archive: " + codeSourceFile); |
|
|
|
} |
|
|
|
} |
|
|
|
if (file != null && file.exists() |
|
|
|
if (codeSourceFile != null && codeSourceFile.exists()) { |
|
|
|
&& file.getAbsolutePath().contains("/WEB-INF/")) { |
|
|
|
String path = codeSourceFile.getAbsolutePath(); |
|
|
|
String path = file.getAbsolutePath(); |
|
|
|
int webInfPathIndex = path |
|
|
|
path = path.substring(0, path.indexOf("/WEB-INF/")); |
|
|
|
.indexOf(File.separatorChar + "WEB-INF" + File.separatorChar); |
|
|
|
return new File(path); |
|
|
|
if (webInfPathIndex >= 0) { |
|
|
|
|
|
|
|
path = path.substring(0, webInfPathIndex); |
|
|
|
|
|
|
|
return new File(path); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|