Commit Graph

95 Commits

Author SHA1 Message Date
Joakim Erdfelt dd7dda2c53
Move FileID from deploy to util
+ Move static methods from other
  places to FileID or URIUtil
  - MultiReleaseJarFile
  - Resource
  - MetaInfConfiguration
+ Improve testing of URIUtil and FileID
2022-08-01 21:48:00 -05:00
Joakim Erdfelt caff1b036b
Jetty 12 - Cleanup MultiReleaseJarFile to use newFileSystem behaviors built into JVM (#8328)
* Cleanup MultiReleaseJarFile to use newFileSystem behaviors built into JVM
* Adding more testing to MultiReleaseJarFile
* Updating AnnotationParser and MetaInfConfiguration
* Created URIUtil.streamOf(URLClassLoader) to aid
  in proper conversion of URLClassLoader.toURLs to URIs
* Introduce URIUtil.fixBadJavaIoFileUrl
  Addresses bad java.io.File.toURL().toURI() issues
  file:/path to file:///path
* Better URI pool/key behaviors in FileSystemPool
* no arg AnnotationParser uses ASM_VERSION
2022-07-29 10:08:32 -05: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
Lachlan 0f35590ab4
Merge pull request #8341 from eclipse/jetty-12.0.x-dispatcher-fixes
fix some tests for Jetty 12 ee10 servlets
2022-07-28 18:57:19 +10:00
Ludovic Orban 4856a7d065 keep, un-deprecate and rename Resource.getReadableByteChannel() and Resource.getInputStream()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-27 16:04:22 +02:00
Greg Wilkins 2275e1c2c6
Refactored MultiException into ExceptionUtil (#8340) 2022-07-27 18:07:57 +10:00
Greg Wilkins 8d9c32bdee Include FileSystemPool is the server dump so we can monitor any leakage.
Added JMX annotations
Added as unmanaged bean to Server
2022-07-27 15:26:07 +10:00
Greg Wilkins 2e9c6de1e2 Immutable ResourceCollection
Include FileSystemPool is the server dump so we can monitor any leakage.
2022-07-27 15:20:27 +10:00
Lachlan Roberts e6db23afc5 fix use of canonicalPath after #8343
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-07-27 11:29:12 +10:00
Lachlan Roberts f81bdc9711 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-dispatcher-fixes 2022-07-27 11:27:26 +10:00
Greg Wilkins d369adf55b
Jetty 12.0.x canonical uri (#8343)
Somehow the URIUtil class had switched over the meaning of normal and canonical. This PR renames them to correct this:
 * canonical paths are always normal
 * Always canonicalize paths passed from the application
 * Switch the URIUtil names for canonical and normal
2022-07-27 09:58:50 +10:00
Ludovic Orban 38d22f3153 #8285 - improve Resource to mapped ByteBuffer logic
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-26 13:47:44 +02:00
Lachlan Roberts b6bc0f0b07 fix tests in EncodedURITest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-07-26 15:25:34 +10:00
Joakim Erdfelt 0d75a87886
Adding comment about usage 2022-07-25 09:59:14 -05:00
Simone Bordet 69a7b06f06
Jetty 12.0.x retainable chunk (#8325)
Made Chunk implement Retainable, and protocol implementations
to link the RetainableByteBuffer all the way to the Chunk.

Extended Retainable to have both a retain() and a release() methods.

Removed HTTP/2's ISession and IStream, now just using HTTP2Session and HTTP2Stream.
Removed *.Adapter classes in favor of interfaces with default methods.

Javadoc additions and clarifications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-25 13:22:14 +02:00
Joakim Erdfelt ba4405e05b
Comment/TODO updates for Jetty 12.0.x from review with @gregw 2022-07-24 21:31:30 -05:00
Simone Bordet 8cb09e4c59
Re-enabled jetty-ee9-proxy and jetty-ee10-proxy modules. (#8289)
* Re-enabled jetty-ee9-proxy and jetty-ee10-proxy modules.
Introduced TunnelSupport to abstract out the tunnelling capabilities.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-22 13:36:47 +02:00
Joakim Erdfelt 131fd00285
Jetty-12 : Testing for ResourceHandler / ResourceService (#8327)
* Overhaul of ResourceHandlerTest
* Making ResourceHandlerTest more flexible for testing
  + Each test has it's own docroot
  + Each test decides what it's docroot contents are
* Support QuotedQualityCSV(List<String>)
2022-07-21 15:12:19 -05:00
Joakim Erdfelt b241446e66
Jetty-12 : Fixing ContextHandlerCollectionTest (#8322)
* Fixing ContextHandlerCollectionTest

* Disabling array Indentation checkstyle

+ Doesn't play nice with Java 17 new switch/case usages.
2022-07-20 16:42:45 -05:00
Joakim Erdfelt 55805c92ee
Better logger message 2022-07-19 11:45:55 -05:00
Joakim Erdfelt fcc443088f
More work cleaning up DefaultServletTest
+ fixed DefaultServletTest.testOutputStreamAndCharsetFiltered
+ fixed DefaultServletTest.testWriterAndCharsetFiltered
2022-07-15 13:17:11 -05:00
Joakim Erdfelt 9b5d4ce8e2
More DefaultServletTest additions 2022-07-14 18:38:21 -05:00
Joakim Erdfelt 0dc65e5588
Fixing DefaultServlet Alias Checking
+ Fixing DefaultServletTest.testSymLinks
2022-07-14 16:17:12 -05:00
Joakim Erdfelt da2af1141a
DefaultServlet include effort (incomplete) 2022-07-14 15:56:49 -05:00
Joakim Erdfelt e1ee2e3fa2
Fixing DefaultServletTest.testWelcomeMultipleDefaultServletsDifferentBases 2022-07-14 15:33:02 -05:00
Greg Wilkins cdc1b079ae ee8 ee9 ee10 webapp demos
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-07-14 16:15:22 +10:00
Joakim Erdfelt 3beaa3997f
Updates to DefaultServletTest 2022-07-13 17:10:43 -05:00
Greg Wilkins 1e4fd831ba Remove Generic Request/Response #8291
Replaced Generic Request/Response
2022-07-13 20:26:54 +10:00
Greg Wilkins 7a962e4676 Remove Generic Request/Response #8291
Handle welcome servlets
Handle sendError within dispatcher
2022-07-13 16:58:03 +10:00
Greg Wilkins 13aa9b0bc8 Remove Generic Request/Response #8291
Handle redirection of encoded directory URIs
2022-07-13 16:58:03 +10:00
Greg Wilkins 821d5c8d36 Remove Generic Request/Response #8291
Basic welcome files working
2022-07-13 16:58:03 +10:00
Greg Wilkins 2978472c2b Remove Generic Request/Response #8291
Use HttpFields in request and response
2022-07-13 13:36:51 +10:00
Greg Wilkins ee58d2a51f Remove Generic Request/Response #8291
Use HttpFields in request
2022-07-13 13:05:07 +10:00
Greg Wilkins 4d52f4a704 Re-enabled tests for #8291
Reenabled some tests and started fixing the issues found:
 + Get the correct API context
 + Handle fragments and queries on non slash directory redirection
2022-07-13 13:03:35 +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 be95da326d
Bis: Jetty 12.0.x resource handler and default servlet (#8276)
Made ResourceService use a generic request so it can be used as handler or from servlets.    This is only a temporary solution.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-07-13 09:21:27 +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 b521fc4e7e Merge remote-tracking branch 'origin/jetty-12.0.x-enable-distribution-tests-rebase' into jetty-12.0.x 2022-07-09 16:08:36 +10:00
Greg Wilkins 676833e57e
Jetty-12 Improved Content testing and javadoc (#8263)
Improved Content javadoc
Fixed ContentSourceTest that was consuming the same ByteBufferSource multiple times.
Using ByteBufferPool.NOOP instead of allocating NoopByteBufferPool.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-08 14:52:28 +02:00
Greg Wilkins 33487b5fd8 reenable ee9 distribution tests
Signed-off-by: Jan Bartel <janb@webtide.com>
2022-07-08 09:51:29 +10:00
Greg Wilkins 4c827b986c Minor renaming for clarity
Renamed Blocking to Blocker
Added Handler.Processor.Blocking and Handler.Processor.NonBlocking
2022-07-07 19:38:23 +10:00
Greg Wilkins 6247ab0dbc Implemented ContextHandler availability 2022-07-06 11:58:40 +10:00
Greg Wilkins d28586bd2e Fixed test 2022-07-04 13:14:54 +10:00
Greg Wilkins 6405eeb9e4 Further RBBP improvements 2022-07-04 13:14:44 +10:00
Greg Wilkins 8ecb4b8669 Fixed merge 2022-07-04 12:34:53 +10:00
Greg Wilkins d1e6c772c6 updated moved HttpConnection to 12
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-07-04 11:34:30 +10:00
Greg Wilkins b4aba02830 move HttpConnection
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-07-04 11:33:01 +10:00
Greg Wilkins fe83ea87dc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-07-04 11:32:33 +10:00
Greg Wilkins ea5bedf072
Jetty 12.0.x deployment (#8208)
Deploy webapps for different environments from the same webapps directory.
The maximal environment known to the AppProviders is used as the default environment.
An explicit environment can be set in a properties file for an application, which is also used for property substitution in any context xml file.
2022-06-30 09:51:19 +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