ASF Bugzilla – Attachment 29384 Details for
Bug 53854
DefaultServlet directory listings for aliased directories do not seem to work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated patch, works with BaseDirContext and FileDirContext
bug-53854-1.patch (text/plain), 1.72 KB, created by
Daniel Mikusa
on 2012-09-18 16:37:57 UTC
(
hide
)
Description:
Updated patch, works with BaseDirContext and FileDirContext
Filename:
MIME Type:
Creator:
Daniel Mikusa
Created:
2012-09-18 16:37:57 UTC
Size:
1.72 KB
patch
obsolete
>Index: java/org/apache/naming/resources/BaseDirContext.java >=================================================================== >--- java/org/apache/naming/resources/BaseDirContext.java (revision 1383597) >+++ java/org/apache/naming/resources/BaseDirContext.java (working copy) >@@ -1614,7 +1614,7 @@ > protected abstract String doGetRealPath(String name); > > // -------------------------------------------------------- Private Methods >- private AliasResult findAlias(String name) { >+ protected AliasResult findAlias(String name) { > AliasResult result = new AliasResult(); > > String searchName = name; >@@ -1634,7 +1634,7 @@ > return result; > } > >- private static class AliasResult { >+ protected static class AliasResult { > BaseDirContext dirContext; > String aliasName; > } >Index: java/org/apache/naming/resources/FileDirContext.java >=================================================================== >--- java/org/apache/naming/resources/FileDirContext.java (revision 1383597) >+++ java/org/apache/naming/resources/FileDirContext.java (working copy) >@@ -834,12 +834,21 @@ > if (!canPath.equals(absPath)) > return null; > } >- >- } else { >- return null; >+ >+ return file; > } >- return file; >- >+ >+ // Is this an alias >+ if (!aliases.isEmpty()) { >+ AliasResult result = findAlias(name); >+ if (result.dirContext != null) { >+ file = new File(result.dirContext.doGetRealPath(result.aliasName)); >+ if (file.exists() && file.canRead()) >+ return file; >+ } >+ } >+ >+ return null; > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 53854
:
29357
| 29384