Skip to content

Commit

Permalink
use canonical path instead of absolute; fixes #248
Browse files Browse the repository at this point in the history
  • Loading branch information
klieber committed Jun 27, 2014
1 parent 5a26f4d commit 37a2f44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -35,11 +35,11 @@ public Handler createHandler() throws IOException {
String contextRoot = StringUtils.prependIfMissing(context.getContextRoot(),"/");
ContextHandler handler = contexts.addContext(contextRoot, "");
handler.setAliases(true);
handler.setHandler(this.createResourceHandler(true, context.getDirectory().getAbsolutePath(), null));
handler.setHandler(this.createResourceHandler(true, context.getDirectory().getCanonicalPath(), null));
}

ContextHandler rootContextHandler = contexts.addContext("/", "");
rootContextHandler.setHandler(this.createResourceHandler(false, this.configuration.getBasedir().getAbsolutePath(), new String[]{this.getWelcomeFilePath()}));
rootContextHandler.setHandler(this.createResourceHandler(false, this.configuration.getBasedir().getCanonicalPath(), new String[]{this.getWelcomeFilePath()}));
rootContextHandler.setAliases(true);

ContextHandler classPathContextHandler = contexts.addContext("/classpath", "");
Expand Down
Expand Up @@ -76,9 +76,9 @@ public void before() {
public void testCreateHandler() throws IOException {
when(createsRunner.getRunnerFile()).thenReturn(WELCOME_FILE);

when(sourceDirectory.getAbsolutePath()).thenReturn(SOURCE_DIRECTORY);
when(specDirectory.getAbsolutePath()).thenReturn(SPEC_DIRECTORY);
when(baseDirectory.getAbsolutePath()).thenReturn(BASE_DIRECTORY);
when(sourceDirectory.getCanonicalPath()).thenReturn(SOURCE_DIRECTORY);
when(specDirectory.getCanonicalPath()).thenReturn(SPEC_DIRECTORY);
when(baseDirectory.getCanonicalPath()).thenReturn(BASE_DIRECTORY);

when(configuration.getBasedir()).thenReturn(baseDirectory);
when(configuration.getProjectClassLoader()).thenReturn(new ProjectClassLoaderFactory().create());
Expand Down

0 comments on commit 37a2f44

Please sign in to comment.