Commit Graph

26 Commits

Author SHA1 Message Date
Jan Bartel 91c7a51cbc
Issue #8921 Fix normalization of META-INF resources for quickstart (#8922)
* Issue #8921 Fix normalization of META-INF resources for quickstart
2022-12-06 08:51:44 +11:00
Greg Wilkins 976ab3df8d
ResourceCollection should not have a path (#8711)
ResourceCollection should not have a path
Nor name, nor filename unless all resources agree on it.
revert combine and related methods to return Resource and not explicitly a ResourceCollection, as if there is only 1, then a collection is not needed
cleanup ResourceCollection creation. Avoid sanity checks on resolved resources.
2022-11-01 15:54:50 +11:00
Greg Wilkins ac6abb307d
ResourceHandler set base resource as string (#8735)
* ResourceHandler set base resource as string

* ResourceCollection should not have a path

fixed tests
2022-10-21 09:32:54 +11:00
Joakim Erdfelt 259deea2f7
Jetty 12 - Resource `resolve()` and `newResource()` return null on resources that do not exist (#8702)
* Resource `resolve()` and `newResource()` return null on resources that do not exist
* Introduce `Resources` utility methods and use them
* Updating javadoc
2022-10-19 15:50:37 -05:00
Joakim Erdfelt 45e706cb67
Move Resource.combine() methods to ResourceFactory 2022-10-13 14:08:21 -05:00
Joakim Erdfelt 597a6af31d
Jetty 12 : `Descriptor` cleanup (#8611)
+ Sanity check Resource being provided
+ Descriptor toString changed to include full URI to descriptor
  so that it can be used consistently in Logging and Exception messages.
+ New Descriptor.toURI() for use in Servlet Source and other logging messages
+ Servlet Source value is now the URI of the Descriptor
+ More cleanup around `Source` location/name
   .getResource() must be a Resource
   as it's used in the AnnotationIntrospector
   all others use new .getName()
   Not all location/name usages can be loaded as
   a Resource.
2022-09-28 09:09:16 -05:00
Joakim Erdfelt 144c78fe39
Jetty 12 : QuickStart generation based on Path, usage based on Resource (#8614)
* QuickStart generation based on Path, usage based on Resource
* QuickStart usage in jetty-maven-plugin uses Path
* Cleanup MavenWebAppContext constructor exceptions
* Improving quickStart stream filtering and array conversion
* Creating WEB-INF, if missing, now more reliable
2022-09-23 12:50:52 -05:00
Joakim Erdfelt b75896c2f5
Jetty 12 : XmlAppendable use Charset, not String (#8609)
* XmlAppendable use charset, not string
* Collapse Constructors into one
2022-09-22 15:06:02 -05:00
Greg Wilkins af5fecd18d
Jetty 12 : Rename resourceBase to baseResource (#8310)
* rename to baseResource
2022-08-15 12:24:13 +10:00
Ludovic Orban 94a60dd862 fix NPE's
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-04 10:55:52 +02:00
Ludovic Orban 7a28563bcc move toURI to URIUtil
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 17:04:22 +02:00
Ludovic Orban cb348c8d15 rename of() -> combine()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:06:32 +02:00
Ludovic Orban fb0290c88a replace ROOT references with root()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:51:57 +02:00
Ludovic Orban f943d095f4 rework ResourceFactory and Resource according to redux3 prototype
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 11:32:21 +02:00
Jan Bartel ffe99495ea Fix for changes to Resource. 2022-08-03 11:41:49 +10:00
Jan Bartel ef1cd2b35d Remove deprecated classes from annotation initialization. 2022-08-02 12:00:59 +10:00
Joakim Erdfelt c6c0eb0313
Jetty-12 : Immutable ResourceCollection and Context based mount management (#8337)
* Immutable ResourceCollection with mount management.

* Internal List<Resource> is now immutable so that .getResources() cannot be modified.
* Improved Resource.toJarFileUri implementation that keeps the deep archive references
* Introducing Resource.mountCollection() methods
  + ResourceCollection is now a private class
  + Resource.mountCollection() returns a Mount
  + Places that use this technique are now putting the Mount in the context's beans for the context to close those mounts.
* Cleanup names/comments in FileSystemResourceTest
* Adding missing test of attempting to create a Resource from a URI `jar:file:foo.jar!/` while not mounted.
* Reworked ResourceCollection behaviors based on feedback.
  + Eliminated all Resource.mountCollection() methods except the Collection<URI> one.
* Eliminated Resource.mountIfNeeded(Resource)
* Eliminated Resource.fromList implementations
* Introduced @gregw Resource.of() implementations
* Introduced Resource.split() to honor old split logic from Jetty 9/10/11, with glob support, but now it only converts to List<URI>
* Remove IOException from Mount.root() method
* ResourceCollection now flattens and uniques any nested ResourceCollection entries it encounters
* Expanded ResourceCollectionTest to cover more code paths
* Add ResourceTest for new split() method
* Fixing testcase to use a directory that exists on setExtraClasspath
* Increase reliability of WebAppContextTests
* Updates for working with webapp.extraClasspath
* Introduced Resource.unwrapContainer to help in servlet cases where the raw JAR path should be represented in a ServletContext attribute.
* Made FileSystemPool.containerUri just use new Resource.unwrapContainer
* webapp MetaData updated to use URIs references to Libs (not File objects)
* jetty-ee#-maven-plugin use URIs for its classpath tracking to aid in mounting issues later
* webapp extraClasspath supports raw JAR references as well as glob now, supported by Resource.split(String)
2022-07-28 08:59:17 -05:00
Olivier Lamy 68206ce880
fix some filtering of files for ee9 to ee8 conversion (#8311)
* restore ee8-quickstart
* use our special resources filtering
* do not filter some extensions

Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
2022-07-15 11:20:52 +10:00
Greg Wilkins 9b1cb302b6
Cleanup Resource.Mount (#8284)
* Introduced the `mountIfNeeded` method to cleanup mount code and reduce checks for "jar:"
 * Fixed Quickstart mounting close.
 * Improved error message
 * Fixed tests for mount cleanup
 * More forgiving newResource(URI) implementation
 * Even more forgiving newResource(URI) implementation
2022-07-13 09:25:14 +10:00
Ludovic Orban 23a0203547 rework Resource API (#8106)
* remove Resource.getFile() and replace its usages with Resource.getPath()
* remove all public PathResource ctors + add non-leaky FS mounting mechanism + interpret string as Path when not a schemed URI
* rename Resource.getResource to Resource.resolve, specifying that the subpath is URI-path-interpreted
* remove useless API methods + deprecate all path-related API
* make subpaths beginning with / resolved as relative to the given uri
* introduce filesystem pooling and generalize resource resolving code
* remove URLResource
* remove unneeded factory method
* both file: and jrt: should not be pooled
* move deprecated impls from PathResource down to Resource + fix some tests
* handle Resource's pointing to non-existent jar files
* Force Resource URIs to end with "/" when the resource is a directory
* Produce warning if attempting to release a mounted filesystem uri that doesn't exist in the pool.

Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2022-07-12 10:10:30 +10:00
Jan Bartel e31166f333 WIP fix quickstart tests 2022-07-08 12:48:16 +10:00
Greg Wilkins 33487b5fd8 reenable ee9 distribution tests
Signed-off-by: Jan Bartel <janb@webtide.com>
2022-07-08 09:51:29 +10:00
Jan Bartel 5c267ce7ed
Jetty 12.0.x eex jettymavenplugin (#8200)
* Fix ee9/10 jetty maven plugin and refactor it tests
2022-06-29 17:18:18 +10:00
Jan Bartel 80854f8eea Fix jetty-ee9-home build by enabling jetty-ee9-quickstart. 2022-06-27 11:30:02 +10:00
Greg Wilkins 04acdb72f0 Jetty-12 Restructure
Copied over non ee10 components from the hackathon branch

Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Ludovic Orban <lorban@webtide.com>
Co-authored-by: Olivier Lamy <olamy@webtide.com>
Co-authored-by: Simone Bordet <sbordet@webtide.com>
2022-05-03 15:50:54 +02:00
Greg Wilkins 825fa75993 Jetty-12 Restructure
Git moved files into their known new locations

Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Ludovic Orban <lorban@webtide.com>
Co-authored-by: Olivier Lamy <olamy@webtide.com>
Co-authored-by: Simone Bordet <sbordet@webtide.com>
2022-05-03 15:46:22 +02:00