| 209 | |
| 210 | |
| 211 | @Override |
| 212 | public File getAppBaseFile() { |
| 213 | |
| 214 | if (appBaseFile != null) { |
| 215 | return appBaseFile; |
| 216 | } |
| 217 | |
| 218 | File file = new File(getAppBase()); |
| 219 | |
| 220 | // If not absolute, make it absolute |
| 221 | if (!file.isAbsolute()) { |
| 222 | file = new File(getCatalinaBase(), file.getPath()); |
| 223 | } |
| 224 | |
| 225 | // Make it canonical if possible |
| 226 | try { |
| 227 | file = file.getCanonicalFile(); |
| 228 | } catch (IOException ioe) { |
| 229 | // Ignore |
| 230 | } |
| 231 | |
| 232 | Path appBasePath = file.toPath(); |
| 233 | Path basePath = getCatalinaBase().toPath(); |
| 234 | if (basePath.startsWith(appBasePath)) { |
| 235 | log.warn(sm.getString("standardHost.problematicAppBaseParent", getName())); |
| 236 | } |
| 237 | |
| 238 | this.appBaseFile = file; |
| 239 | return file; |
| 240 | } |
| 241 | |
| 242 | |
| 243 | @Override |