-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Overlay of Combined Resources #10760
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was my suggested fix, but it is not correct. We need to stay within the Resource abstraction.
...etty-ee10-annotations/src/main/java/org/eclipse/jetty/ee10/annotations/AnnotationParser.java
Outdated
Show resolved
Hide resolved
...etty-ee10-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/OverlayManager.java
Show resolved
Hide resolved
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of 6 suspect APIs.
I've found 2 broken APIs so far.
Still working on writing tests for the other 4.
CombinedResource.copyTo(Resource)
- test if destination is a different file system type (BROKEN, have fixed code)
CombinedResource.contains(Resource other)
- test if other is a different file system type
CombinedResource.getPathTo(Resource other)
- test if other is a different file system type
Resource.contains(Resource other)
- test if other is a different file system type
- test if self is 1 JAR, and other is a different JAR
Resource.getPathTo(Resource other)
- test if other is a different file system type (BROKEN, not possible to fix, revert?)
Resource.getAllResources()
- test what happens if you have a symlink loop
Path relative = base.relativize(path); | ||
|
||
int count = relative.getNameCount(); | ||
int count = path.getNameCount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version of FileID.isHidden()
isn't useful for anyone.
Only the isHidden(Path base, Path path)
version is meaningful.
If we have a baseResource like /path/.hidden/jetty/base
and a test path within it of web/index.html
, then this should return false on isHidden(base, path)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the two arg version was/is doing is getting the relative path and checking the segments. This is just the version for code that already has the relative path.
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/FileID.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/FileID.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/CombinedResource.java
Outdated
Show resolved
Hide resolved
+ handles cross file system copy as well.
+ handles cross resource better.
+ handles cross resource better.
jetty-core/jetty-util/src/test/java/org/eclipse/jetty/util/resource/CombinedResourceTest.java
Show resolved
Hide resolved
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources Reduced fallback to URI string manipulation.
@joakime I merged your PR, but have subsequently modified it to reduce the usage of URI string manipulation, as that is very error prone (for example a |
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources Reduced fallback to URI string manipulation.
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources Reduced fallback to URI string manipulation.
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/CombinedResource.java
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/CombinedResource.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java
Show resolved
Hide resolved
...etty-ee10-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/OverlayManager.java
Show resolved
Hide resolved
.../jetty-ee9-annotations/src/main/java/org/eclipse/jetty/ee9/annotations/AnnotationParser.java
Show resolved
Hide resolved
Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser Fixed numerous bugs in CombinedResource list and getAllResources Reduced fallback to URI string manipulation.
This branch is failing the following tests ...
Oddly, these are failing on |
Ah, those are failing due to ...
Something @olamy is taking care of.
I'll merge this branch up from |
…overlay-combined-resources
Merging as CI failures are unrelated. |
Changes to the
Resource
class in jetty-12 lead to the breakage of war overlays for the jetty maven plugin, and also the scanning of directories when the base resource of a webapp is aCombinedResource
.