diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000000000000000000000000000000000000..667577d3e973f00fb99458cd36cf562fe55afb9e --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,59 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Run Servlet TCK + +on: + push: + branches: [ "jakarta" ] + paths-ignore: + - 'pages/**' + pull_request: + branches: [ "jakarta" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + name: 下载servlet TCK + with: + repository: jakartaee/servlet + ref: c533204b8fb04a4b04169e697b3f140b8ea2deb9 + path: jakartaee/servlet + - uses: actions/checkout@v4 + name: 下载 smart-http + with: + repository: smartboot/smart-http + path: smart-http + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build smart-http + run: mvn -B install --file smart-http/pom.xml -Dmaven.compiler.source=8 -Dmaven.compiler.target=8 + - name: Build servlet TCK with Maven + run: mvn -B install --file jakartaee/servlet/tck/pom.xml -Dmaven.compiler.source=8 -Dmaven.compiler.target=8 + - name: Build smart-servlet with Maven + run: mvn -B install --file pom.xml + - name: Build with Maven + run: mvn -B verify --file tck/pom.xml -Dbasedir=tck_tmp -Dmaven.test.failure.ignore=true + - name: Build with Maven + run: mvn -B surefire-report:report --file tck/pom.xml + + - name: Upload test report + uses: actions/upload-artifact@v2 + if: always() # 确保即使有失败的测试也会上传报告 + with: + name: test-report + path: tck/target/site diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000000000000000000000000000000000000..6f02f992135642e7afc46d64f4f982fa1a5a46be --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,41 @@ +name: Deploy to GitHub Pages + +on: + # Trigger the workflow every time you push to the `main` branch + # Using a different branch name? Replace `main` with your branch’s name + push: + branches: [jakarta] + paths: + - 'pages/**' + # Allows you to run this workflow manually from the Actions tab on GitHub. + workflow_dispatch: + +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout your repository using git + uses: actions/checkout@v4 + - name: Install, build, and upload your site output + uses: withastro/action@v2 + with: + path: pages # The root location of your Astro project inside the repository. (optional) + node-version: 21.1.0 # The specific version of Node that should be used to build your site. Defaults to 18. (optional) + package-manager: yarn@ # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000000000000000000000000000000000..b217b4ebddad48662114977a28771e9f3f624624 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,69 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Distribution + +on: + push: + branches: [ "jakarta" ] + paths-ignore: + - 'pages/**' + pull_request: + branches: [ "jakarta" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + name: 下载 smart-http + with: + repository: smartboot/smart-http + path: smart-http + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build smart-http + run: mvn -B install --file smart-http/pom.xml -Dmaven.compiler.source=8 -Dmaven.compiler.target=8 + - name: Build smart-servlet with Maven + run: mvn -B install --file pom.xml + + # 企业版打包 + - uses: actions/checkout@v4 + with: + repository: smartboot/smart-servlet-enterprise + token: ${{ secrets.GH_PAT }} + path: smart-servlet-enterprise + + - name: 构建 smart-jakarta-bin 制品 + run: mvn clean install -f smart-servlet-enterprise/pom.xml + - name: Build distribution with Maven + run: mvn clean package -Pbin -f smart-servlet-enterprise/deploy/pom.xml + - name: 上传 smart-jakarta-bin 制品 + uses: actions/upload-artifact@v4 + with: + name: smart-jakarta-bin-${{ github.ref_name }} + compression-level: 0 + path: smart-servlet-enterprise/deploy/target/*.tar.gz + + - name: 构建 smart-jakarta-springboot 制品 + run: mvn clean package -Pspringboot -f smart-servlet-enterprise/deploy/pom.xml + - name: 上传 smart-jakarta-springboot 制品 + uses: actions/upload-artifact@v4 + with: + name: smart-jakarta-springboot-${{ github.ref_name }} + compression-level: 0 + path: smart-servlet-enterprise/deploy/target/*.tar.gz + diff --git a/pages/README.md b/pages/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e09bf55fefe3d61bdafd7082bf11a64e895d337a --- /dev/null +++ b/pages/README.md @@ -0,0 +1,55 @@ +# Starlight Starter Kit: Basics + +[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build) + +``` +npm create astro@latest -- --template starlight +``` + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics) +[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics) +[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs) + +> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! + +## 🚀 Project Structure + +Inside of your Astro + Starlight project, you'll see the following folders and files: + +``` +. +├── public/ +├── src/ +│ ├── assets/ +│ ├── content/ +│ │ ├── docs/ +│ │ └── config.ts +│ └── env.d.ts +├── astro.config.mjs +├── package.json +└── tsconfig.json +``` + +Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. + +Images can be added to `src/assets/` and embedded in Markdown with a relative link. + +Static assets, like favicons, can be placed in the `public/` directory. + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :------------------------ | :----------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:4321` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro -- --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). diff --git a/pages/astro.config.mjs b/pages/astro.config.mjs new file mode 100644 index 0000000000000000000000000000000000000000..20ade812961fc39c68704fcd54fbac78626331cc --- /dev/null +++ b/pages/astro.config.mjs @@ -0,0 +1,44 @@ +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +// https://astro.build/config +export default defineConfig({ + site: 'https://smartboot.tech/', + base: '/smart-servlet', + trailingSlash: "always", + integrations: [ + starlight({ + title: 'smart-servlet', + social: { + github: 'https://github.com/smartboot/smart-servlet', + }, + // 为此网站设置英语为默认语言。 + defaultLocale: 'root', + locales: { + root: { + label: '简体中文', + lang: 'zh-CN', + }, + // 英文文档在 `src/content/docs/en/` 中。 + en: { + label: 'English', + lang: 'en' + } + }, + sidebar: [ + { + label: '指南', + autogenerate: {directory: 'guides'}, + }, + { + label: '下载', + autogenerate: { directory: 'download' }, + }, + { + label: '参考', + autogenerate: { directory: 'reference' }, + }, + ], + }), + ], +}); diff --git a/pages/package.json b/pages/package.json new file mode 100644 index 0000000000000000000000000000000000000000..78eaa2a8fbf66868bf455332c88913ed4c959dd3 --- /dev/null +++ b/pages/package.json @@ -0,0 +1,17 @@ +{ + "name": "", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/starlight": "^0.25.2", + "astro": "^4.10.2", + "sharp": "^0.32.5" + } +} \ No newline at end of file diff --git a/pages/public/favicon.svg b/pages/public/favicon.svg new file mode 100644 index 0000000000000000000000000000000000000000..cba5ac140a25951a20704b481a65514838f0f4b6 --- /dev/null +++ b/pages/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/public/smart-servlet.svg b/pages/public/smart-servlet.svg new file mode 100644 index 0000000000000000000000000000000000000000..ca70606f171a6ab20eb2581f8650fc4023bd3616 --- /dev/null +++ b/pages/public/smart-servlet.svg @@ -0,0 +1,4 @@ + + + +
smart-http
smart-http
Container
Container
ServletContextRuntime 1 ..N
ServletContextRuntime 1 ..N
ServletContext
ServletContext
Provider
Provider
Servlet
Servlet
Filter
Filter
沙箱环境(SandBox)
沙箱环境(SandBox)
Listener
Listener
Websocket
Websocket
其他自定义插件
其他自定义插件
smart servlet
smart servlet
Plugins
Plugins
Dispatcher
Dispatcher
Mapping
Mapping
Cookie
Cookie
Session
Session
smart-socket
smart-socket
@三刀
@三刀
AsyncContext
AsyncContext
Text is not SVG - cannot display
\ No newline at end of file diff --git a/pages/public/springboot_demo.png b/pages/public/springboot_demo.png new file mode 100644 index 0000000000000000000000000000000000000000..46c30ab9424d3b5ad351a255161d767a17367289 Binary files /dev/null and b/pages/public/springboot_demo.png differ diff --git a/pages/public/springboot_res.png b/pages/public/springboot_res.png new file mode 100644 index 0000000000000000000000000000000000000000..fb479a6b4911ee421948bc750173ea7d31ca79c3 Binary files /dev/null and b/pages/public/springboot_res.png differ diff --git a/pages/src/assets/houston.webp b/pages/src/assets/houston.webp new file mode 100644 index 0000000000000000000000000000000000000000..930c164974ad8eb528878f15a98016249b8cf546 Binary files /dev/null and b/pages/src/assets/houston.webp differ diff --git a/pages/src/content/config.ts b/pages/src/content/config.ts new file mode 100644 index 0000000000000000000000000000000000000000..45f60b01542e20c173efeebce00c60abcc38e9e0 --- /dev/null +++ b/pages/src/content/config.ts @@ -0,0 +1,6 @@ +import { defineCollection } from 'astro:content'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ schema: docsSchema() }), +}; diff --git a/pages/src/content/docs/download/jakarta_6.md b/pages/src/content/docs/download/jakarta_6.md new file mode 100644 index 0000000000000000000000000000000000000000..f90ea884783bb850b162641841f7a030e740abf7 --- /dev/null +++ b/pages/src/content/docs/download/jakarta_6.md @@ -0,0 +1,5 @@ +--- +title: Servlet 6.1 版本 +description: A reference page in my new Starlight docs site. +--- + diff --git a/pages/src/content/docs/download/servlet_4.mdx b/pages/src/content/docs/download/servlet_4.mdx new file mode 100644 index 0000000000000000000000000000000000000000..66c663b92b892d0dde34ee4260b96d2b4552f7a7 --- /dev/null +++ b/pages/src/content/docs/download/servlet_4.mdx @@ -0,0 +1,172 @@ +--- +title: Servlet 4.0 版本 +description: A reference page in my new Starlight docs site. +--- +import { Aside} from '@astrojs/starlight/components'; + + + +## [smart-servlet v1.4发布(2024-06-01)](https://gitee.com/smartboot/smart-servlet/releases/tag/v1.4) + +1. 新增 `HttpSessionIdListener` 规范实现。 +2. 新增 `HttpServletRequest#changeSessionId` 规范实现。 +3. 优化 `ServletContext#getResourcePaths` 规范实现。 +4. 移除 Principal 相关实现。 +5. 调整 `Servlet` 初始化策略,适配 spring 环境。 + +发版详情:[https://mp.weixin.qq.com/s/9fYcFl0NtjaT7QmWgYkrpA](https://mp.weixin.qq.com/s/9fYcFl0NtjaT7QmWgYkrpA) + +## [smart-servlet v1.3发布(2024-05-18)](https://gitee.com/smartboot/smart-servlet/releases/tag/v1.3) +1. 优化 ServletContext#getMimeType 规范实现。 +2. 优化 ServletContext#addListener 规范实现。 +3. 优化 ServletContext#addServlet 规范实现。 +4. 优化 RequestDispatcher 规范实现。 +5. 优化监听器的启动流程 +6. web.xml 增加 mime-mapping、security-role-ref的解析 +7. favicon 图标更新 +8. smart-http 升级至v1.4.2 + +## [smart-servlet v1.2发布(2024-05-08)](https://gitee.com/smartboot/smart-servlet/releases/tag/v1.2) +1. 实现 FilterRegistration#setAsyncSupported 规范。 +2. 实现 ServletRegistration#setAsyncSupported 规范。 +3. 实现 ServletRequest#startAsync 规范。 +4. 实现 ServletContext#getContext 规范。 +5. 优化 HttpServletResponse#sendError 规范实现。 +6. 优化 HttpServletResponse#sendRedirect 规范实现。 +7. 优化 HttpServletResponse#getCharacterEncoding 规范实现。 +8. 优化 HttpServletResponse#setLocale 规范实现。 +9. 优化 ServletOutputStream 实现规范。 +10. SandBox 移除 MemoryPoolProvider。 +11. SandBox 新增 VendorProvider。 +12. SandBox 新增 AsyncContextProvider。 + +## [smart-servlet v1.1发布(2024-04-14)](https://gitee.com/smartboot/smart-servlet/releases/tag/v1.1) +1. HttpServletRequestImpl 新增附件接口。 +2. 调整 WebsocketProvider 接口设计,移除onHandShark,新增getWebSocketServerContainer。 +3. 优化 Provider 升级提示文案。 +4. 优化 javax.websocket 规范实现。 + +## [smart-servlet v0.9发布(2024-02-25)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.9) +1. 优化 javax.servlet.ServletRequest#getCharacterEncoding 规范实现。 +2. 优化 javax.servlet.ServletResponse#getCharacterEncoding 规范实现。 +3. 实现 javax.servlet.ServletContext#declareRoles 规范。 +4. 实现 javax.servlet.ServletContext#getSessionTimeout 规范。 +5. 实现 javax.servlet.ServletContext#setSessionTimeout 规范。 +6. springboot starter 支持集成 smart-servlet 企业版功能。 +7. 沙箱环境新增 Servlet 关于安全规范的适配。 + +## [smart-servlet v0.8发布(2024-02-17)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.8) +1. 修复墨菲安全扫描提示的问题 +2. 支持pem文件的 SSL/TLS 服务。 + +## [smart-servlet v0.7发布(2024-01-19)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.7) +1. 优化 ServletResponse#setContentType 规范实现。 +2. 优化 ServletContext#getResourcePaths 规范的实现 +3. 优化输出流的字符集编码处理。 +4. 优化 RequestDispatcher 规范实现。 +5. 升级 smart-http 至 1.3.8 + +## [smart-servlet v0.6发布(2024-01-11)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.6) +1. 提供不完整的 AsyncContext 规范实现。 +2. 提供 locale-encoding-mapping-list 规范的实现 +3. 优化 ServletResponse#flushBuffer 规范实现。 +4. 优化 ServletResponse#setLocale 规范实现。 +5. 提供请求异步处理能力。 +6. 新增控制台技术支持信息露出。 +7. 优化日志输出。 +8. 清理大量无用代码。 + + +## [smart-servlet v0.5发布(2023-09-28)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.5) +1. 实现 FilterRegistration#getServletNameMappings 规范。 +2. 实现 ServletContext#getResourcePaths 规范。 +3. 实现 ServletContext#getJspConfigDescriptor 规范。 +4. 实现 ServletContext#requestCharacterEncoding 规范。 +5. 实现 ServletContext#responseCharacterEncoding 规范。 +6. 优化 ServletResponse#setCharacterEncoding 规范实现。 +7. 优化 ServletResponse#getContentType 规范实现。 +8. 优化 ServletResponse#setContentType 规范实现。 +9. 优化 ServletResponse#getOutputStream 规范实现。 +10. 移除 javax.servlet-api,替换为:jakarta.servlet-api:5.0.0。 +11. 移除 javax.annotation-api,替换为:jakarta.annotation-api:2.0.0。 +12. 移除 javax.websocket-api,替换为:jakarta.websocket-api:2.0.0。 +13. 升级 smart-http 至 1.3.1。 +14. 升级 maven-plugin-plugin 至 3.9.0。 +15. 升级 springboot 至 3.0.6。 + +## [smart-servlet v0.4发布(2023-07-13)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.4) +1. smart-http升级至1.2.7 +2. 优化ErrorPage规范实现。 +3. 实现AsyncContext规范。 +4. 实现ServletRequest#startAsync规范 +5. 优化HttpServletResponse#addCookie、getCharacterEncoding、setContentType规范实现。 +6. 优化ServletOutputStream#write规范。 +7. 修复ServletRequestDispatcherWrapper#setParameters方法名单词拼写错误问题。 +8. 修复ServletContext#setAttribute中replace情况下的value提取错误问题。 +9. 修复当某个类实现多个Listener接口时,仅其中一个Listener生效的问题。 + +## [smart-servlet v0.3发布(2023-05-14)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.3) +1. 实现HttpSessionAttributeListener规范 +2. 实现ServletRequestAttributeListener规范 +3. 实现SessionCookieConfig规范 +4. 实现HttpServletResponse#setLocale、getLocale规范。 +5. 实现 WebListener、WebServlet规范 +6. 支持 Servlet asyncSupported 解析 +7. 支持web-fragment.xml加载 +8. 优化HttpServletResponse规范:Cookie、CharacterEncoding、ContentType。 +9. 优化 Session Cookie. +10. 优化ServletPrintWriter +11. 优化Servlet URL匹配算法。 +12. 优化web.xml中url-pattern的解析 +13. 升级smart-http至1.2.1 +14. 升级servlet-api至4.0.1 +15. 升级spring-boot至2.7.11 +16. 引入servlet tck测试套件 + +## [smart-servlet v0.2.1发布(2023-05-07)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.2.1) +1. 修复ServletRequest#getServerPort规范实现中的端口解析错误问题。 +2. 升级smart-http至1.2.0。 +3. 实现ServletRequest#isSecure规范。 +4. 优化Websocket的适配策略。 +5. 更新readme中的过时配置。 + +## [smart-servlet v0.1.9发布(2022-11-23)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.1.9) +1. 【新特性】实现 servlet 3.1 的文件上传规范。 +2. 【新特性】实现 HttpServletRequest#getRemoteUser 接口规范。 +3. 【新特性】新增War包解压工具。 +4. 【优化】开辟三方依赖存放package,现已集成:bcel、commons-fileupload、commons-io +5. 【优化】Http响应报文头Server显示:smart-servlet +6. 【优化】临时文件存放于系统参数 java.io.tmpdir 指定的路径。 +7. 【优化】springboot starter模块禁用 debug 模式。 + +## [smart-servlet v0.1.8发布(2022-10-30)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.1.8) +1. 【更新】`smart-servlet-maven-plugin` 和 `smart-servlet-spring-boot-starter` 发布至中央仓库,改善使用体验。 +2. 【更新】原 plugins 模块下的功能合并至 servlet-core,改善使用体验。 +3. 【更新】升级适配的 spring-boot 版本至 `2.7.5`。 +4. 【bugfix】修复发行包初次解压 war 包时加载该容器服务不生效的问题。 +5. 【bugfix】修复`smart-servlet-spring-boot-starter` 启动报错问题。 + + +## [smart-servlet v0.1.7发布(2022-10-22)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.1.7) +1. 调整 dispatcher 插件的启用时机。 +2. 完善 RequestDispatcher#forward 方法的规范实现。 +3. 解析并提取 web.xml 中的 display-name、description 配置信息 +4. 优化 WrappedRuntimeException 的异常传播性。 +5. 降低 default servlet的执行优先级。 +6. 禁用 name=Path 的Cookie。 +7. 实现 ServletRequest#getServerName,ServletRequest#getServerPort 等规范 +8. 改进服务的启动策略。 +9. 优化 smart-servlet-maven-plugin 插件。 +10. springboot starter 支持自定义端口号。 + +## [smart-servlet v0.1.6发布(2022-10-07)](https://gitee.com/smartboot/smart-servlet/releases/tag/v0.1.6) +1. 扩展插件功能,添加Servlet容器的注册监听。 +2. 隔离各Servlet容器应用间的缓存资源。 +3. 优化Servlet容器的退出策略。 +4. 运用多线程提升 HandlesTypes 的扫描性能。 +5. smart-servlet maven运行插件添加启动耗时的输出。 +6. Maven 插件 maven-plugin-plugin 升级至 3.6.4 +7. Maven 插件 maven-compiler-plugin 升级至 3.10.1 +8. smart-http 升级至 1.1.16 \ No newline at end of file diff --git a/pages/src/content/docs/guides/about.mdx b/pages/src/content/docs/guides/about.mdx new file mode 100644 index 0000000000000000000000000000000000000000..aa2b76aaae7443f9393195c7503dcc0019f971a7 --- /dev/null +++ b/pages/src/content/docs/guides/about.mdx @@ -0,0 +1,39 @@ +--- +title: 概述 +sidebar: + order: 1 +--- +import { Badge,Aside,LinkCard, CardGrid} from '@astrojs/starlight/components'; + +smart-servlet 是一个基于 Jakarta Servlet 6.1 的轻量级 Servlet 容器,适用于 Java 21+ 环境。 +![](/smart-servlet/smart-servlet.svg) + + +## 功能指引 + + + + + + + + +## 资源下载 + + + + + + + +**开源仓库:** + +- Github:[https://github.com/smartboot/smart-servlet](https://github.com/smartboot/smart-servlet) +- Gitee:[https://gitee.com/smartboot/smart-servlet](https://gitee.com/smartboot/smart-servlet) + + +## 目标用户 +- 有着信创需求的企业用户。 +- 对服务并发能力要求高的企业用户。 +- 对技术有着强烈热爱的个人开发者。 \ No newline at end of file diff --git a/pages/src/content/docs/guides/maven-plugin.md b/pages/src/content/docs/guides/maven-plugin.md new file mode 100644 index 0000000000000000000000000000000000000000..12e86b9c6f7574aa6031b8d53296ce0ff833f443 --- /dev/null +++ b/pages/src/content/docs/guides/maven-plugin.md @@ -0,0 +1,28 @@ +--- +title: Maven 插件 +sidebar: + order: 2 +--- + +这是一种类似:`tomcat-maven-plugin`的使用方式,通常应用于 Java Web 工程的本地开发环境。 +集成该插件只需在 pom.xml 中加入以下代码,便可以在 IDE 中启动 servlet 服务。 +```xml + + + + tech.smartboot.jakarta + smart-servlet-maven-plugin + ${最新版本号} + + 8080 + / + + + + +``` +插件的版本建议采用最新版本,另外主要的配置项包括: +- port:servlet服务启动的监听端口 +- path:Servlet容器上下文路径,即 ContextPath,通常以`/`表示。当然也支持自定义,但必须以`/`开头 + +完成配置后在控制台输入:`mvn package smart-servlet:run`即可。 diff --git a/pages/src/content/docs/guides/springboot.md b/pages/src/content/docs/guides/springboot.md new file mode 100644 index 0000000000000000000000000000000000000000..8e0b6d2cc3137fb484858bc060200c0a3d755528 --- /dev/null +++ b/pages/src/content/docs/guides/springboot.md @@ -0,0 +1,81 @@ +--- +title: Springboot 部署 +date: 2022-12-04 16:44:58 +permalink: /smart-servlet/springboot.html +article: false +--- + +用过 springboot 的 spring-boot-starter-tomcat 或者 spring-boot-starter-undertow 的朋友应该对此不陌生。 + +smart-servlet-spring-boot-starter 本质上就是 smart-servlet 对 spring-boot-starter-web 的另一种适配。 + +只需按照以下方式调整 springboot 工程中 pom.xml 文件的配置,便可将 springboot 的默认 Servlet 容器替换成 smart-servlet。 + +```xml + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + + org.smartboot.servlet + smart-servlet-spring-boot-starter + ${最新版本号} + + +``` +#### 企业版集成 +springboot 的企业版在集成上相较于开源版会多出一些额外的步骤。 + +因为所依赖的企业版 jar 包没有开源,也没有发布到 maven 中央仓库。 +用户需要通过官方渠道获取相应的资源包,再导入至本地工程中完成 smart-servlet 企业版的集成。 + +**步骤一:** + +获取 springboot 资源包 **smart-servlet-springboot-${version}.tar.gz** 并解压。 +解压后的目录内容如下: +![](/smart-servlet/springboot_res.png) + +**步骤二:** + +拷贝资源文件至你的 springboot 工程内。具体如下: +- lib 目录:拷贝至 springboot 工程目录下。 +- smart-servlet 目录:拷贝至 springboot 工程的 `src/main/resources` 路径下。 + +**步骤三:** +修改springboot工程内的pom.xml文件,添加如下配置: +```xml + + org.smartboot.servlet + base + 1.0 + system + ${pom.basedir}/lib/base-1.2.jar + +``` +另外,需要在 springboot 打包插件`spring-boot-maven-plugin`中添加配置:`includeSystemScope`, +该配置的作用是在打可执行jar包时,将 smart-servlet 企业版的依赖包也包含进去。 +```xml + + + + org.springframework.boot + spring-boot-maven-plugin + + + true + + + + +``` +**自此,便完成了 smart-servlet 企业版的集成。** +![](/smart-servlet/springboot_demo.png) diff --git a/pages/src/content/docs/guides/tar.md b/pages/src/content/docs/guides/tar.md new file mode 100644 index 0000000000000000000000000000000000000000..3d88ed29eb200e8c5454f2ac8a839265aacf8697 --- /dev/null +++ b/pages/src/content/docs/guides/tar.md @@ -0,0 +1,7 @@ +--- +title: War 包部署 +date: 2022-12-04 16:44:58 +permalink: /smart-servlet/war.html +article: false +--- + diff --git a/pages/src/content/docs/index.mdx b/pages/src/content/docs/index.mdx new file mode 100644 index 0000000000000000000000000000000000000000..ee09e9bcd03b6cba3d2833f6f3dacc2e39fb5d7c --- /dev/null +++ b/pages/src/content/docs/index.mdx @@ -0,0 +1,37 @@ +--- +title: smart-servlet +description: 真自研、真轻量、真极速的 Servlet 容器. +template: splash +hero: + tagline: 自研、轻量、极速,重新定义 Servlet 容器! + image: + file: ../../assets/houston.webp + actions: + - text: 产品手册 + link: ./guides/about/ + icon: right-arrow + variant: primary + - text: 下载最新版 + link: /smart-servlet/download/jakarta_6/ + icon: external +--- + +import { Card, CardGrid } from '@astrojs/starlight/components'; + + +## 特性 + + + + 分别适配 `javax-servlet 4.0` 及 `jakarta-servlet 6.1`,涵盖 Java 8~21 应用场景。 + + + 做性能最强的、体积最小的 Servlet 容器。轻松实现十万级QPS,重新定义 Web 速度。 + + + 嵌入式集成、动静混合部署、自定义 SPI、轻松实现业务扩展。 + + + 时代需要的不再仅仅是一个 web 服务器。并发稳定性、数据安全性、服务可靠性,由我来守护。 + + diff --git a/pages/src/content/docs/performance/ab_smart-servlet.jpeg b/pages/src/content/docs/performance/ab_smart-servlet.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..83f5c22600b5ea9cf38cb0f2a60a5bdc2d7dc463 Binary files /dev/null and b/pages/src/content/docs/performance/ab_smart-servlet.jpeg differ diff --git a/pages/src/content/docs/performance/ab_smart-servlet_1000.jpeg b/pages/src/content/docs/performance/ab_smart-servlet_1000.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..d4e84b47702671455f06079e594a90d0cc4accd9 Binary files /dev/null and b/pages/src/content/docs/performance/ab_smart-servlet_1000.jpeg differ diff --git a/pages/src/content/docs/performance/ab_smart-servlet_150.jpeg b/pages/src/content/docs/performance/ab_smart-servlet_150.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..7193ee0ec6ba4fee22178069fd0513498d1c3ffd Binary files /dev/null and b/pages/src/content/docs/performance/ab_smart-servlet_150.jpeg differ diff --git a/pages/src/content/docs/performance/ab_tomcat.jpeg b/pages/src/content/docs/performance/ab_tomcat.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..6623a30c435e5a52355efd9567f778899a66f3ba Binary files /dev/null and b/pages/src/content/docs/performance/ab_tomcat.jpeg differ diff --git a/pages/src/content/docs/performance/ab_tomcat_150.jpeg b/pages/src/content/docs/performance/ab_tomcat_150.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..aeef511fd226cd0b93953f15aba3b5532a4831bb Binary files /dev/null and b/pages/src/content/docs/performance/ab_tomcat_150.jpeg differ diff --git a/pages/src/content/docs/performance/test-data.md b/pages/src/content/docs/performance/test-data.md new file mode 100644 index 0000000000000000000000000000000000000000..377edfe3d1fd8c1f99652cec3ec450e75688dfac --- /dev/null +++ b/pages/src/content/docs/performance/test-data.md @@ -0,0 +1,104 @@ +--- +title: test-data +date: 2022-10-27 12:36:13 +permalink: /pages/c9f9df/ +--- +# 评测数据 + +## 一、测试结果 + +| 规范清单 | Tomcat 9 | smart-servlet | +| ------------ | -------- | ------------- | +| Servlet Spec | 4.0 | 3.1 | +| Jsp Spec | 2.3 | N/A | + +在相同的测试工程下: + +- smart-servlet 性能表现结果比 tomcat 高出 50%~100 以上 。 +- tomcat 压测期间 CPU 使用率高于 40%,smart-servlet 压测时低于 40% 。 +- tomcat 线程数随并发数递增,上限 200;smart-servlet 线程数固定,不受并发数影响 。 +- 内存开销两者基本持平。 + +> 评测在不同的测试方式、测试环境下会有不同的表现。本文结论仅供参考,请以自己的实际测试结果为准。 + +## 二、压测过程 + +测试方式:先执行 3 次压测,使服务器完成预热,每次压测前都确保端口充分释放。 + +### 2.1 ApacheBench 压测 + +#### 2.1.1 并发量:100 + +**测试命令** + +```shell +ab -k -c100 -t 10 http://127.0.0.1:8080/examples/servlets/servlet/HelloWorldExample +``` + +**测试结果** + +| tomcat / smart-servlet | Requests per second [count/sec] | Transfer rate [Kbytes/sec] | 累计YGC | 累计FGC | +| ---------------------- | ------------------------------- | -------------------------- | ------- | ------- | +| 第 1 轮 | 18536.55 / 37129.34 | 11689.08 / 22806.99 | 18 / 22 | 1 / 0 | +| 第 2 轮 | 21194.69 / 32753.81 | 13365.34 / 20119.28 | 23 / 28 | 1 / 0 | +| 第 3 轮 | 22588.81 / 36523.28 | 14244.43 / 22434.71 | 27 / 34 | 1 / 0 | +| 第 4 轮 | 20171.81 / 35668.17 | 12720.25 / 21909.45 | 32 / 42 | 1 / 0 | +| 第 5 轮 | 21957.96 / 30439.92 | 13846.64 / 18697.96 | 37 / 52 | 1 / 0 | + +**压测小结:** + +- 从 ab 产生的结果来看 smart-servlet 的性能比 tomcat 高出 50%~100% 。 +- 而且从下图可以看到压测期间 tomcat 线程数增长至 118,而 smart-servlet 始终稳定在 23。 +- tomcat 不能很好的支持 http1.0 keep-alive。ab采用了的协议是 Http1.0,压测 tomcat 过程中发现实际建立的连接数超过了500个,而 smart-servlet 稳定在100个。 + +![](./ab_tomcat.jpeg) + +![](./ab_smart-servlet.jpeg) + +#### 2.1.2 并发量:150 + +**测试命令** + +```shell +ab -k -c150 -t 10 -r http://127.0.0.1:8080/examples/servlets/servlet/HelloWorldExample +``` + +**测试结果** + +| Tomcat / smart-servlet | Requests per second [count/sec] | Transfer rate [Kbytes/sec] | 累计YGC | 累计FGC | +| ---------------------- | ------------------------------- | -------------------------- | ------- | ------- | +| 第 1 轮 | 18402.97 / 40874.22 | 11605.02 / 25107.31 | 30 / 16 | 1 / 0 | +| 第 2 轮 | 25367.06 / 45381.93 | 15996.65 / 27876.21 | 37 / 19 | 1 / 0 | +| 第 3 轮 | 25935.43 / 41616.07 | 16355.01 / 25563.00 | 44 / 21 | 1 / 0 | +| 第 4 轮 | 26399.91 / 44049.76 | 16647.90 / 27057.91 | 52 / 25 | 1 / 0 | +| 第 5 轮 | 24079.55 / 49325.96 | 15184.70 / 30298.86 | 61 / 29 | 1 / 0 | + +**压测小结:** + +- 在 150 的并发下 smart-servlet 的性能比 tomcat 高出 50%~100% 。 +- tomcat 线程数增长值 169,smart-servlet 维持23个不变。 + +![](./ab_tomcat_150.jpeg) + +![](./ab_smart-servlet_150.jpeg) + +#### 2.1.3 并发量:1000 + +**测试命令** + +```shell +ab -k -c1000 -t 10 -r http://127.0.0.1:8080/examples/servlets/servlet/HelloWorldExample +``` + +**测试结果** + +| smart-servlet | Requests per second [count/sec] | Transfer rate [Kbytes/sec] | 累计YGC | 累计FGC | +| ------------- | ------------------------------- | -------------------------- | ------- | ------- | +| 第 1 轮 | 37633.03 | 23116.38 | 15 | 0 | +| 第 2 轮 | 35776.23 | 21975.83 | 17 | 0 | +| 第 3 轮 | 39916.91 | 24519.27 | 19 | 0 | +| 第 4 轮 | 38895.61 | 23891.93 | 21 | 0 | +| 第 5 轮 | 39318.90 | 24151.94 | 22 | 0 | + +压测小结:在此并发量下 tomcat 失败率太高,不再进行评测。 + diff --git a/pages/src/content/docs/reference/license.mdx b/pages/src/content/docs/reference/license.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3dfd49f74191bd2d46fd4a4482a9f58f3548fdf1 --- /dev/null +++ b/pages/src/content/docs/reference/license.mdx @@ -0,0 +1,207 @@ +--- +title: 商业授权 +--- +import { Badge,Card,LinkCard, CardGrid} from '@astrojs/starlight/components'; + +## 许可证 +我们持续增强 smart-servlet 的核心能力并保持开源,希望可以满足大多数小企业的需求。 + +当你的企业在商业模式和技术支持等方面有更高要求时,可以选择商业许可证和商业插件。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
开源版商业版企业版
价格免费联系我们联系我们
许可证
许可证类型AGPL 3.0商业许可证企业许可证
永久授权年订阅制
授权版本全部全部一个根版本
授权范围
smart-servlet内核
开源插件
商业插件
使用限制
适配 springboot
maven 插件
Session 安全性
向客户分发 smart-servlet
支持
社区支持
专属和及时的 bug 修复
专属的使用咨询
专属的扩展开发咨询
优先排期新功能
定制插件
+ + +## 常见问题 +
+ 购买商业许可证获得的功能与开源版本的功能有区别吗? + 没有。商业许可证与开源许可证对应的代码完全相同。 + + smart-servlet 采用 AGPL-3.0 与商业许可双重授权,你可以根据自己的需求来选择许可证类型。 +
+ +
+ 是否要购买商业许可证才能用在商业环境? + 不是。smart-servlet 的内核和开源插件是 AGPL 3.0 协议, + 只要你遵循协议,并且保留 smart-servlet 版权信息和版本信息,就可以免费使用。 +
+ + + +
+ 什么情况下需要购买商业许可证? + 如果你有以下任何需求,则需要购买商业许可证: + + - 对 smart-servlet 的代码做了更改,或者扩展了自己的插件,但你不想将这些产出物以 AGPL 协议开源 + - 将 smart-servlet 集成到你的产品中,但不想将自己的产品以 AGPL 协议开源 + - 你希望获得 smart-servlet 团队的高级技术支持 +
+ +
+ 如何理解“永久授权”? + 没有过期时间,不需要按年付费,一旦你购买了商业许可证或者商业插件,就会获得当前根版本的永久授权,可以永久使用。 +
+ +
+ 什么是“根版本”? + 商业许可证和商业插件的许可范围为一个根版本,比如从 1.0 至 1.x 均获得授权。 + + 当需要跨根版本升级的时候,比如从 1.x 升级到 2.x,可以以 50% 折扣价格购买。 +
+ + +
+ 商业授权和商业插件的高级技术支持有效期是多久? + 技术支持有效期为 6 个月。 + + 我们相信在这段时间内你的团队可以完全掌握该版本的使用,并验证该版本是否满足你的需求。 +
+ +
+ 商业版可以试用吗? + 可以。 + + 联系我们可获得运行时有效期 30 分钟的商业版。 +
+ +
+ smart-servlet 支持 javax-servlet 吗? + 支持定制化服务。 + + smart-servlet 起初便是源于 javax-servlet 4.0 规范。结合 smart-servlet 自身的产品定位,继续投入 javax-servlet 不利于项目发展。 + + 若有这方面需求的客户,可以尝试走定制化服务。 +
+ + + + + +## 如何购买 +通过邮件或微信联系我们,与我们的核心团队探讨方案,获得独家支持。 + +[联系我们](/service.html#联系方式) \ No newline at end of file diff --git a/pages/src/env.d.ts b/pages/src/env.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..acef35f175aae528d22fdc6b91e819aa52837fd9 --- /dev/null +++ b/pages/src/env.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/pages/tsconfig.json b/pages/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..bcbf8b50906a72a17cb6578418123daad8ad375d --- /dev/null +++ b/pages/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "astro/tsconfigs/strict" +} diff --git a/pom.xml b/pom.xml index ba035948814510f050c528d6f75d31a0d4e1c022..54b54f77b4e256d7d547c4e68408deefa2a61504 100644 --- a/pom.xml +++ b/pom.xml @@ -3,13 +3,13 @@ smart-servlet-parent a lightweight servlet container 4.0.0 - org.smartboot.servlet + tech.smartboot.jakarta smart-servlet-parent 1.5 pom - 1.5.2 + 1.5.5 1.5 UTF-8 @@ -31,25 +31,10 @@ - org.smartboot.servlet + tech.smartboot.jakarta servlet-core ${smartservlet.version} - - - - - - - - - - - - - - - http://git.oschina.net/smartboot/smart-servlet @@ -112,8 +97,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + 17 + 17 UTF-8 diff --git a/servlet-core/pom.xml b/servlet-core/pom.xml index a8d710abe6edf957a26c9e21064ae89d6785d6b0..4be531043d89670b9350fb19765515d9dc0b50bb 100644 --- a/servlet-core/pom.xml +++ b/servlet-core/pom.xml @@ -14,7 +14,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> smart-servlet-parent - org.smartboot.servlet + tech.smartboot.jakarta 1.5 servlet-core @@ -30,40 +30,32 @@ smart-http-server - - - - - - - - - - - - - - javax.servlet - javax.servlet-api - 4.0.1 + jakarta.servlet + jakarta.servlet-api + 6.0.0 - javax.annotation - javax.annotation-api - 1.3.2 + jakarta.annotation + jakarta.annotation-api + 2.1.1 - javax.websocket - javax.websocket-api - 1.1 + jakarta.websocket + jakarta.websocket-api + 2.1.1 + + + jakarta.websocket + jakarta.websocket-client-api + 2.1.1 - - - - - + + org.mortbay.jasper + apache-jsp + 10.1.5 + \ No newline at end of file diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandshakeResponseImpl.java b/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandshakeResponseImpl.java deleted file mode 100644 index c4ab0c721dd8fe3f97693c276c429374166619a9..0000000000000000000000000000000000000000 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandshakeResponseImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.smartboot.servlet.plugins.websocket.impl; - -import javax.servlet.http.HttpServletResponse; -import javax.websocket.HandshakeResponse; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public class HandshakeResponseImpl implements HandshakeResponse { - public HandshakeResponseImpl(HttpServletResponse response) { - - } - - @Override - public Map> getHeaders() { - return Collections.emptyMap(); - } -} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassFormatException.java b/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassFormatException.java deleted file mode 100644 index ea4fef005dd25cd71f2a32ba5756824933a72a0d..0000000000000000000000000000000000000000 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassFormatException.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.smartboot.servlet.third.bcel.classfile; - -/** - * Thrown when the BCEL attempts to read a class file and determines - * that the file is malformed or otherwise cannot be interpreted as a - * class file. - */ -public class ClassFormatException extends RuntimeException { - - private static final long serialVersionUID = 3243149520175287759L; - - public ClassFormatException() { - super(); - } - - - public ClassFormatException(final String s) { - super(s); - } -} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/Closeable.java b/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/Closeable.java deleted file mode 100644 index b8338ebb7643f03a0147470b73aac78afd928cb6..0000000000000000000000000000000000000000 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/Closeable.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.smartboot.servlet.third.commons.fileupload.util; - -import java.io.IOException; - -/** - * Interface of an object, which may be closed. - */ -public interface Closeable { - - /** - * Closes the object. - * - * @throws IOException An I/O error occurred. - */ - void close() throws IOException; - - /** - * Returns, whether the object is already closed. - * - * @return True, if the object is closed, otherwise false. - * @throws IOException An I/O error occurred. - */ - boolean isClosed() throws IOException; - -} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/ParseException.java b/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/ParseException.java deleted file mode 100644 index dfedad00ebd145968903d7466c35dfab91d0dcda..0000000000000000000000000000000000000000 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/ParseException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.smartboot.servlet.third.commons.fileupload.util.mime; - -/** - * @since 1.3 - */ -final class ParseException extends Exception { - - /** - * The UID to use when serializing this instance. - */ - private static final long serialVersionUID = 5355281266579392077L; - - /** - * Constructs a new exception with the specified detail message. - * - * @param message the detail message. - */ - public ParseException(String message) { - super(message); - } - -} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/AnnotationsLoader.java b/servlet-core/src/main/java/tech/smartboot/jakarta/AnnotationsLoader.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/AnnotationsLoader.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/AnnotationsLoader.java index d7e6fd5b506fd5379063fd6c2124313c9b8f958e..0cbb6bd433984bebb6ca797d97bbabd0115a7c26 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/AnnotationsLoader.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/AnnotationsLoader.java @@ -8,21 +8,27 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; - +package tech.smartboot.jakarta; + +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.annotation.HandlesTypes; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.annotation.WebInitParam; +import jakarta.servlet.annotation.WebListener; +import jakarta.servlet.annotation.WebServlet; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.third.bcel.Const; -import org.smartboot.servlet.third.bcel.classfile.AnnotationEntry; -import org.smartboot.servlet.third.bcel.classfile.ClassParser; -import org.smartboot.servlet.third.bcel.classfile.JavaClass; -import org.smartboot.servlet.util.CollectionUtils; - -import javax.servlet.ServletContainerInitializer; -import javax.servlet.annotation.HandlesTypes; -import javax.servlet.annotation.WebInitParam; -import javax.servlet.annotation.WebListener; -import javax.servlet.annotation.WebServlet; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.FilterMappingInfo; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.enums.FilterMappingType; +import tech.smartboot.jakarta.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.classfile.AnnotationEntry; +import tech.smartboot.jakarta.third.bcel.classfile.ClassParser; +import tech.smartboot.jakarta.third.bcel.classfile.JavaClass; +import tech.smartboot.jakarta.util.CollectionUtils; +import tech.smartboot.jakarta.util.PathMatcherUtil; + import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -31,6 +37,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; @@ -70,9 +77,10 @@ public class AnnotationsLoader { */ private boolean handlesTypesNonAnnotations = false; - private Map> annotations = new HashMap<>(); + private final Map> annotations = new HashMap<>(); private final Map servlets = new HashMap<>(); + private final Map filters = new HashMap<>(); public AnnotationsLoader(ClassLoader classLoader) { this.classLoader = classLoader; @@ -138,6 +146,10 @@ public class AnnotationsLoader { return servlets; } + public Map getFilters() { + return filters; + } + public List getAnnotations(Class clazz) { List classes = annotations.get(clazz); return CollectionUtils.isEmpty(classes) ? Collections.emptyList() : classes; @@ -211,6 +223,36 @@ public class AnnotationsLoader { String annotationName = getClassName(entry.getAnnotationType()); if (WebListener.class.getName().equals(annotationName)) { annotations.computeIfAbsent(WebListener.class, aClass -> new ArrayList<>()).add(className); + } else if (WebFilter.class.getName().equals(annotationName)) { + Class clazz = classLoader.loadClass(className); + WebFilter webFilter = clazz.getAnnotation(WebFilter.class); + String name = webFilter.filterName(); + if (StringUtils.isBlank(name)) { + name = className; + } + FilterInfo filterInfo = new FilterInfo(); + filterInfo.setFilterName(name); + filterInfo.setFilterClass(className); + filterInfo.setAsyncSupported(webFilter.asyncSupported()); + for (WebInitParam param : webFilter.initParams()) { + filterInfo.addInitParam(param.name(), param.value()); + } + Set set = new HashSet<>(Arrays.asList(webFilter.dispatcherTypes())); + for (String urlPattern : webFilter.urlPatterns()) { + FilterMappingInfo filterMappingInfo = + new FilterMappingInfo(name, + FilterMappingType.URL, null, PathMatcherUtil.addMapping(urlPattern), + set); + filterInfo.addMapping(filterMappingInfo); + } + for (String servletName : webFilter.servletNames()) { + FilterMappingInfo filterMappingInfo = + new FilterMappingInfo(name, + FilterMappingType.SERVLET, servletName, null, + set); + filterInfo.addMapping(filterMappingInfo); + } + filters.put(name, filterInfo); } else if (WebServlet.class.getName().equals(annotationName)) { Class clazz = classLoader.loadClass(className); WebServlet webServlet = clazz.getAnnotation(WebServlet.class); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/Container.java b/servlet-core/src/main/java/tech/smartboot/jakarta/Container.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/Container.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/Container.java index e10d124a7ad87e4526c33a1e9dd4200070ba5cf7..21ad8e8acdcceae673806f5eab6c006a453fd3b2 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/Container.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/Container.java @@ -8,8 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; +package tech.smartboot.jakarta; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletResponse; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; import org.smartboot.http.common.utils.StringUtils; @@ -18,24 +22,21 @@ import org.smartboot.http.server.HttpResponse; import org.smartboot.http.server.HttpServerConfiguration; import org.smartboot.http.server.WebSocketRequest; import org.smartboot.http.server.WebSocketResponse; -import org.smartboot.servlet.conf.DeploymentInfo; -import org.smartboot.servlet.conf.WebAppInfo; -import org.smartboot.servlet.exception.WrappedRuntimeException; -import org.smartboot.servlet.handler.FilterMatchHandler; -import org.smartboot.servlet.handler.HandlerContext; -import org.smartboot.servlet.handler.HandlerPipeline; -import org.smartboot.servlet.handler.ServletMatchHandler; -import org.smartboot.servlet.handler.ServletRequestListenerHandler; -import org.smartboot.servlet.handler.ServletServiceHandler; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.impl.HttpServletResponseImpl; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.plugins.Plugin; - -import javax.servlet.AsyncContext; -import javax.servlet.DispatcherType; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletResponse; +import tech.smartboot.jakarta.conf.DeploymentInfo; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.WebAppInfo; +import tech.smartboot.jakarta.exception.WrappedRuntimeException; +import tech.smartboot.jakarta.handler.FilterMatchHandler; +import tech.smartboot.jakarta.handler.HandlerContext; +import tech.smartboot.jakarta.handler.HandlerPipeline; +import tech.smartboot.jakarta.handler.ServletMatchHandler; +import tech.smartboot.jakarta.handler.ServletRequestListenerHandler; +import tech.smartboot.jakarta.handler.ServletServiceHandler; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.HttpServletResponseImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.plugins.Plugin; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -64,7 +65,14 @@ public class Container { * http://patorjk.com/software/taag/ * Font Name: Puffy */ - private static final String BANNER = " _ _ _ \n" + " ( )_ (_ ) ( )_ \n" + " ___ ___ ___ _ _ _ __ | ,_) ___ __ _ __ _ _ | | __ | ,_)\n" + "/',__)/' _ ` _ `\\ /'_` )( '__)| | /',__) /'__`\\( '__)( ) ( ) | | /'__`\\| | \n" + "\\__, \\| ( ) ( ) |( (_| || | | |_ \\__, \\( ___/| | | \\_/ | | | ( ___/| |_ \n" + "(____/(_) (_) (_)`\\__,_)(_) `\\__) (____/`\\____)(_) `\\___/'(___)`\\____)`\\__)"; + private static final String BANNER = """ + _ _____ _ _ \s + ( )_ (___ ) ( ) ( )_ \s + ___ ___ ___ _ _ _ __ | ,_) | | _ _ | |/') _ _ _ __ | ,_) _ _\s + /',__)/' _ ` _ `\\ /'_` )( '__)| | _ | | /'_` )| , < /'_` )( '__)| | /'_` ) + \\__, \\| ( ) ( ) |( (_| || | | |_ ( )_| |( (_| || |\\`\\ ( (_| || | | |_ ( (_| | + (____/(_) (_) (_)`\\__,_)(_) `\\__) `\\___/'`\\__,_)(_) (_)`\\__,_)(_) `\\__)`\\__,_) + """; public static final String VERSION = "v1.5"; /** * 注册在当前 Servlet 容器中的运行环境 @@ -317,7 +325,9 @@ public class Container { webAppInfo.getErrorPages().forEach(deploymentInfo::addErrorPage); //register Filter - webAppInfo.getFilters().values().forEach(deploymentInfo::addFilter); + for (FilterInfo filterInfo : webAppInfo.getFilters().values()) { + deploymentInfo.addFilter(filterInfo); + } //register servletContext into deploymentInfo webAppInfo.getContextParams().forEach(deploymentInfo::addInitParameter); @@ -325,9 +335,6 @@ public class Container { webAppInfo.getListeners().forEach(listener -> servletRuntime.getServletContext().addListener(listener)); deploymentInfo.setDynamicListenerState(true); - //register filterMapping into deploymentInfo - webAppInfo.getFilterMappings().forEach(deploymentInfo::addFilterMapping); - webAppInfo.getLocaleEncodingMappings().forEach(deploymentInfo::addLocaleEncodingMapping); webAppInfo.getMimeMappings().forEach((key, value) -> servletRuntime.getServletContext().putMimeTypes(key, value)); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/DefaultServlet.java b/servlet-core/src/main/java/tech/smartboot/jakarta/DefaultServlet.java similarity index 95% rename from servlet-core/src/main/java/org/smartboot/servlet/DefaultServlet.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/DefaultServlet.java index 4f05d88cd2befd5d70b23c225eb1126859800334..df95a307223b4092d8f4fa3e7e19530d0bed19c4 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/DefaultServlet.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/DefaultServlet.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; +package tech.smartboot.jakarta; import org.smartboot.http.common.enums.HeaderNameEnum; @@ -18,16 +18,16 @@ import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; import org.smartboot.http.common.utils.Mimetypes; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.DeploymentInfo; -import org.smartboot.servlet.exception.WrappedRuntimeException; - -import javax.servlet.DispatcherType; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import tech.smartboot.jakarta.conf.DeploymentInfo; +import tech.smartboot.jakarta.exception.WrappedRuntimeException; + +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/ServletContextRuntime.java b/servlet-core/src/main/java/tech/smartboot/jakarta/ServletContextRuntime.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/ServletContextRuntime.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/ServletContextRuntime.java index 86f64849ffe44e74200fc9badba1e24e319bc41b..0ff1a0f4a3154113644544aea421fa8af1796402 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/ServletContextRuntime.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/ServletContextRuntime.java @@ -8,34 +8,34 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; - +package tech.smartboot.jakarta; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebListener; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.DeploymentInfo; -import org.smartboot.servlet.conf.FilterInfo; -import org.smartboot.servlet.conf.ServletContainerInitializerInfo; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.impl.FilterConfigImpl; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.impl.ServletContextWrapperListener; -import org.smartboot.servlet.plugins.Plugin; -import org.smartboot.servlet.provider.AsyncContextProvider; -import org.smartboot.servlet.provider.DispatcherProvider; -import org.smartboot.servlet.provider.FaviconProvider; -import org.smartboot.servlet.provider.SessionProvider; -import org.smartboot.servlet.provider.VendorProvider; -import org.smartboot.servlet.provider.WebsocketProvider; -import org.smartboot.servlet.sandbox.SandBox; - -import javax.servlet.Filter; -import javax.servlet.FilterConfig; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebListener; +import tech.smartboot.jakarta.conf.DeploymentInfo; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.ServletContainerInitializerInfo; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.impl.FilterConfigImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.impl.ServletContextWrapperListener; +import tech.smartboot.jakarta.plugins.Plugin; +import tech.smartboot.jakarta.provider.AsyncContextProvider; +import tech.smartboot.jakarta.provider.DispatcherProvider; +import tech.smartboot.jakarta.provider.FaviconProvider; +import tech.smartboot.jakarta.provider.SessionProvider; +import tech.smartboot.jakarta.provider.VendorProvider; +import tech.smartboot.jakarta.provider.WebsocketProvider; +import tech.smartboot.jakarta.sandbox.SandBox; + import java.io.File; import java.util.ArrayList; import java.util.Collections; @@ -219,6 +219,9 @@ public class ServletContextRuntime { deploymentInfo.addServlet(servletInfo); } }); + deploymentInfo.getHandlesTypesLoader().getFilters().values().forEach(filterInfo -> { + deploymentInfo.addFilter(filterInfo); + }); deploymentInfo.getHandlesTypesLoader().clear(); deploymentInfo.setHandlesTypesLoader(null); // System.out.println("scanHandleTypes use :" + (System.currentTimeMillis() - start)); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/SmartHttpServletRequest.java b/servlet-core/src/main/java/tech/smartboot/jakarta/SmartHttpServletRequest.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/SmartHttpServletRequest.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/SmartHttpServletRequest.java index 9646a398e8c74c5a2c03ee470c730d41b665574c..74c4f085a28920b22902c2099f0f090a20e454a1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/SmartHttpServletRequest.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/SmartHttpServletRequest.java @@ -8,12 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; +package tech.smartboot.jakarta; -import org.smartboot.servlet.conf.ServletInfo; +import jakarta.servlet.http.HttpServletMapping; +import jakarta.servlet.http.HttpServletRequest; import org.smartboot.socket.util.Attachment; - -import javax.servlet.http.HttpServletRequest; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.conf.ServletMappingInfo; /** * @author 三刀 @@ -53,4 +54,6 @@ public interface SmartHttpServletRequest extends HttpServletRequest { * @param attachment 附件对象 */ void setAttachment(Attachment attachment); + + void setServletMappingInfo(ServletMappingInfo servletMappingInfo); } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/WebSocketServerContainer.java b/servlet-core/src/main/java/tech/smartboot/jakarta/WebSocketServerContainer.java similarity index 50% rename from servlet-core/src/main/java/org/smartboot/servlet/WebSocketServerContainer.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/WebSocketServerContainer.java index c3a635bf90222027325d83b6a8806e2d7581c0a1..e0bd0e63b019aac66bd258ce1debd7b5ff1d2530 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/WebSocketServerContainer.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/WebSocketServerContainer.java @@ -8,17 +8,17 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; +package tech.smartboot.jakarta; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.websocket.Endpoint; -import javax.websocket.server.ServerContainer; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.websocket.Endpoint; +import jakarta.websocket.server.ServerContainer; +import jakarta.websocket.server.ServerEndpointConfig; import java.io.IOException; import java.util.Map; public interface WebSocketServerContainer extends ServerContainer { - void doUpgrade(HttpServletRequest request, HttpServletResponse response, final ServerEndpointConfig sec, Endpoint endpoint, Map pathParams) throws ServletException, IOException; +// void doUpgrade(HttpServletRequest request, HttpServletResponse response, final ServerEndpointConfig sec, Endpoint endpoint, Map pathParams) throws ServletException, IOException; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/WebXmlParseEngine.java b/servlet-core/src/main/java/tech/smartboot/jakarta/WebXmlParseEngine.java similarity index 95% rename from servlet-core/src/main/java/org/smartboot/servlet/WebXmlParseEngine.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/WebXmlParseEngine.java index 5ae3402c055c144f8a4e60c3e5158d5774213284..53bb3a077e29a33f6cafac44f4640106810d6d9b 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/WebXmlParseEngine.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/WebXmlParseEngine.java @@ -8,26 +8,26 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet; +package tech.smartboot.jakarta; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.MultipartConfigElement; import org.smartboot.http.common.utils.NumberUtils; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.ErrorPageInfo; -import org.smartboot.servlet.conf.FilterInfo; -import org.smartboot.servlet.conf.FilterMappingInfo; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.conf.WebAppInfo; -import org.smartboot.servlet.enums.FilterMappingType; -import org.smartboot.servlet.util.CollectionUtils; -import org.smartboot.servlet.util.PathMatcherUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import tech.smartboot.jakarta.conf.ErrorPageInfo; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.FilterMappingInfo; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.conf.WebAppInfo; +import tech.smartboot.jakarta.enums.FilterMappingType; +import tech.smartboot.jakarta.util.CollectionUtils; +import tech.smartboot.jakarta.util.PathMatcherUtil; -import javax.servlet.DispatcherType; -import javax.servlet.MultipartConfigElement; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -160,7 +160,7 @@ class WebXmlParseEngine { dispatcher.forEach(dispatcherElement -> dispatcherTypes.add(DispatcherType.valueOf(StringUtils.trim(dispatcherElement.getFirstChild().getNodeValue())))); } FilterMappingInfo filterInfo = new FilterMappingInfo(filterName, StringUtils.isBlank(urlPattern) ? FilterMappingType.SERVLET : FilterMappingType.URL, servletName, StringUtils.isBlank(urlPattern) ? null : PathMatcherUtil.addMapping(urlPattern), dispatcherTypes); - webAppInfo.addFilterMapping(filterInfo); + webAppInfo.getFilters().get(filterName).addMapping(filterInfo); } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/DeploymentInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/DeploymentInfo.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/DeploymentInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/DeploymentInfo.java index 167e9da2e1bf65d61e2e44c29b912afb738b378a..29fdee37c7cf971bda1c8e1062ee1e8eebca275d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/DeploymentInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/DeploymentInfo.java @@ -8,20 +8,20 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; - -import org.smartboot.servlet.AnnotationsLoader; -import org.smartboot.servlet.impl.ServletContextWrapperListener; - -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletContextAttributeListener; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletRequestAttributeListener; -import javax.servlet.ServletRequestListener; -import javax.servlet.annotation.HandlesTypes; -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionIdListener; -import javax.servlet.http.HttpSessionListener; +package tech.smartboot.jakarta.conf; + +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContextAttributeListener; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletRequestAttributeListener; +import jakarta.servlet.ServletRequestListener; +import jakarta.servlet.annotation.HandlesTypes; +import jakarta.servlet.http.HttpSessionAttributeListener; +import jakarta.servlet.http.HttpSessionIdListener; +import jakarta.servlet.http.HttpSessionListener; +import tech.smartboot.jakarta.AnnotationsLoader; +import tech.smartboot.jakarta.impl.ServletContextWrapperListener; + import java.net.URL; import java.util.ArrayList; import java.util.Collections; @@ -45,7 +45,6 @@ public class DeploymentInfo { private final Map errorStatusPages = new HashMap<>(); private final Map errorPages = new HashMap<>(); private final Map filters = new HashMap<>(); - private final List filterMappings = new ArrayList<>(); private final Map initParameters = new HashMap<>(); private List servletContainerInitializers = new ArrayList<>(); private List servletContextAttributeListeners = new ArrayList<>(); @@ -231,14 +230,6 @@ public class DeploymentInfo { return filters; } - public void addFilterMapping(FilterMappingInfo filterMappingInfo) { - filterMappings.add(filterMappingInfo); - } - - public List getFilterMappings() { - return filterMappings; - } - public Map getInitParameters() { return initParameters; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/ErrorPageInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ErrorPageInfo.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/ErrorPageInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/ErrorPageInfo.java index 6ab3bbbf4da931f4becc9dab6f83207deda036ff..8a3a19c2981e87c881fe5e1b5e2fcdb5c1ee9624 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/ErrorPageInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ErrorPageInfo.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; +package tech.smartboot.jakarta.conf; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/FilterInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/FilterInfo.java similarity index 80% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/FilterInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/FilterInfo.java index df97502342a0f12bc4820c896830bfa6bf57b198..77fe94ba1f0ee208a5efcc4be78c07e9604ffadb 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/FilterInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/FilterInfo.java @@ -8,11 +8,14 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; +package tech.smartboot.jakarta.conf; -import javax.servlet.Filter; +import jakarta.servlet.Filter; + +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -22,6 +25,10 @@ import java.util.Map; public class FilterInfo { private final Map initParams = new HashMap<>(); + /** + * web.xml中的Filter映射信息配置 + */ + private final List filterMappings = new ArrayList<>(); private String filterClass; private String filterName; private Filter filter; @@ -77,6 +84,15 @@ public class FilterInfo { this.asyncSupported = asyncSupported; } + public List getMappings() { + return Collections.unmodifiableList(filterMappings); + } + + public FilterInfo addMapping(final FilterMappingInfo mapping) { + filterMappings.add(mapping); + return this; + } + @Override public String toString() { return "FilterInfo{" + diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/FilterMappingInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/FilterMappingInfo.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/FilterMappingInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/FilterMappingInfo.java index 38c5e798875321ff1ba9fc0dc9a6701708043d51..b7f8263d960c0967526185899c704d83802d2af6 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/FilterMappingInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/FilterMappingInfo.java @@ -8,11 +8,11 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; +package tech.smartboot.jakarta.conf; -import org.smartboot.servlet.enums.FilterMappingType; +import tech.smartboot.jakarta.enums.FilterMappingType; -import javax.servlet.DispatcherType; +import jakarta.servlet.DispatcherType; import java.util.Set; /** diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/ServletContainerInitializerInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletContainerInitializerInfo.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/ServletContainerInitializerInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletContainerInitializerInfo.java index 81dc02be060a21325fdbff753ef2dc7b36572926..1aaccac0d3602336976c5f9430142c012580a466 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/ServletContainerInitializerInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletContainerInitializerInfo.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; +package tech.smartboot.jakarta.conf; -import javax.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContainerInitializer; import java.util.Set; /** diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/ServletInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletInfo.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/ServletInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletInfo.java index 131a13b14b3e3d13c6192c458122ba047ee16f55..6ec900195580306ec92267095f80abe73af6f808 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/ServletInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletInfo.java @@ -8,24 +8,24 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; - +package tech.smartboot.jakarta.conf; + +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.UnavailableException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.smartboot.http.common.enums.HttpStatus; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; -import org.smartboot.servlet.impl.ServletConfigImpl; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.util.PathMatcherUtil; - -import javax.servlet.MultipartConfigElement; -import javax.servlet.RequestDispatcher; -import javax.servlet.Servlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.UnavailableException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import tech.smartboot.jakarta.impl.ServletConfigImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.util.PathMatcherUtil; + import java.io.IOException; import java.util.ArrayList; import java.util.Collections; @@ -87,7 +87,7 @@ public class ServletInfo { req.setAttribute(RequestDispatcher.ERROR_MESSAGE, e.getMessage()); req.setAttribute(RequestDispatcher.ERROR_STATUS_CODE, HttpStatus.INTERNAL_SERVER_ERROR.value()); if (finalLocation != null) { - servletContext.getRuntime().getDispatcherProvider().error(servletContext,finalLocation,req,resp); + servletContext.getRuntime().getDispatcherProvider().error(servletContext, finalLocation, req, resp); // req.getRequestDispatcher(finalLocation).forward(req, resp); } else { LOGGER.error("error location is null"); @@ -139,6 +139,7 @@ public class ServletInfo { */ public ServletInfo addMapping(final String mapping) { ServletMappingInfo servletMappingInfo = PathMatcherUtil.addMapping(mapping); + servletMappingInfo.setServletInfo(this); mappings.add(servletMappingInfo); return this; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/ServletMappingInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletMappingInfo.java similarity index 60% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/ServletMappingInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletMappingInfo.java index fef9f2c9d325339a6b5db61b3c5f18e1da1e90fd..089d4f468ad95c35342d88062f116113c8626cbe 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/ServletMappingInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/ServletMappingInfo.java @@ -8,19 +8,20 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; +package tech.smartboot.jakarta.conf; -import org.smartboot.servlet.enums.ServletMappingTypeEnum; +import jakarta.servlet.http.MappingMatch; /** * @author 三刀 * @version V1.0 , 2020/10/11 */ public class ServletMappingInfo { + private ServletInfo servletInfo; private final String mapping; - private final ServletMappingTypeEnum mappingType; + private final MappingMatch mappingType; - public ServletMappingInfo(String mapping, ServletMappingTypeEnum mappingType) { + public ServletMappingInfo(String mapping, MappingMatch mappingType) { this.mapping = mapping; this.mappingType = mappingType; } @@ -29,7 +30,15 @@ public class ServletMappingInfo { return mapping; } - public ServletMappingTypeEnum getMappingType() { + public MappingMatch getMappingType() { return mappingType; } + + public ServletInfo getServletInfo() { + return servletInfo; + } + + public void setServletInfo(ServletInfo servletInfo) { + this.servletInfo = servletInfo; + } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/conf/WebAppInfo.java b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/WebAppInfo.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/conf/WebAppInfo.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/conf/WebAppInfo.java index 864d0bafc5810f67ee043c8aac8d670d3cc49a9a..83866163dbf9f03fa7f99b7aa7fc671156244f9a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/conf/WebAppInfo.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/conf/WebAppInfo.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.conf; +package tech.smartboot.jakarta.conf; import java.util.ArrayList; import java.util.HashMap; @@ -35,10 +35,6 @@ public class WebAppInfo { */ private final Map filters = new HashMap<>(); - /** - * web.xml中的Filter映射信息配置 - */ - private final List filterMappings = new ArrayList<>(); private final List listeners = new ArrayList<>(); @@ -61,9 +57,6 @@ public class WebAppInfo { filters.put(filterInfo.getFilterName(), filterInfo); } - public void addFilterMapping(FilterMappingInfo filterMappingInfo) { - filterMappings.add(filterMappingInfo); - } public void addListener(String listener) { listeners.add(listener); @@ -97,10 +90,6 @@ public class WebAppInfo { return filters; } - public List getFilterMappings() { - return filterMappings; - } - public List getListeners() { return listeners; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/enums/FilterMappingType.java b/servlet-core/src/main/java/tech/smartboot/jakarta/enums/FilterMappingType.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/enums/FilterMappingType.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/enums/FilterMappingType.java index e8776b9afbed3163ddc304324163101a60ec86a5..473398292682bd61621628144a158e8d8a17b36f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/enums/FilterMappingType.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/enums/FilterMappingType.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.enums; +package tech.smartboot.jakarta.enums; /** * Filter映射类型: diff --git a/servlet-core/src/main/java/org/smartboot/servlet/enums/ServletContextPathType.java b/servlet-core/src/main/java/tech/smartboot/jakarta/enums/ServletContextPathType.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/enums/ServletContextPathType.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/enums/ServletContextPathType.java index 8298272fcf22d5b8c52888759a07545dac5d21c9..366598778b5fa735f2be2e88930296f43412db08 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/enums/ServletContextPathType.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/enums/ServletContextPathType.java @@ -8,7 +8,8 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.enums; +package tech.smartboot.jakarta.enums; + /** * @author 三刀 * @version V1.0 , 2020/11/14 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/exception/WrappedRuntimeException.java b/servlet-core/src/main/java/tech/smartboot/jakarta/exception/WrappedRuntimeException.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/exception/WrappedRuntimeException.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/exception/WrappedRuntimeException.java index 329891c350a705d32075eeb9666f5a9c7b78985a..24ab3a7a10d6342190ee0ac13a2ec5e7df5a8089 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/exception/WrappedRuntimeException.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/exception/WrappedRuntimeException.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.exception; +package tech.smartboot.jakarta.exception; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/FilterMatchHandler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/FilterMatchHandler.java similarity index 75% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/FilterMatchHandler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/FilterMatchHandler.java index 792b17dd40bdad29276dee73ceeb0bfdacae0a65..32095dbdca30ca65d6a6150431952d27cb92912e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/FilterMatchHandler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/FilterMatchHandler.java @@ -8,22 +8,21 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; - +package tech.smartboot.jakarta.handler; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.FilterInfo; -import org.smartboot.servlet.conf.FilterMappingInfo; -import org.smartboot.servlet.enums.FilterMappingType; -import org.smartboot.servlet.util.PathMatcherUtil; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.Servlet; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.enums.FilterMappingType; +import tech.smartboot.jakarta.util.PathMatcherUtil; + import java.io.IOException; import java.util.ArrayList; import java.util.Collections; @@ -80,23 +79,23 @@ public class FilterMatchHandler extends Handler { String contextPath = handlerContext.getServletContext().getContextPath(); HttpServletRequest request = (HttpServletRequest) handlerContext.getRequest(); List filters = new ArrayList<>(); - List filterMappings = handlerContext.getServletContext().getDeploymentInfo().getFilterMappings(); Map allFilters = handlerContext.getServletContext().getDeploymentInfo().getFilters(); - filterMappings.stream() - .filter(filterMappingInfo -> filterMappingInfo.getDispatcher().contains(request.getDispatcherType())) - .forEach(filterInfo -> { - if (filterInfo.getMappingType() == FilterMappingType.URL) { - if (PathMatcherUtil.matches(request.getRequestURI(), contextPath.length(), filterInfo.getServletUrlMapping()) > -1) { - filters.add(allFilters.get(filterInfo.getFilterName()).getFilter()); - } - } else if (filterInfo.getMappingType() == FilterMappingType.SERVLET) { - if (handlerContext.getServletInfo() != null && StringUtils.equals(filterInfo.getServletNameMapping(), handlerContext.getServletInfo().getServlet().getServletConfig().getServletName())) { - filters.add(allFilters.get(filterInfo.getFilterName()).getFilter()); + allFilters.values().forEach(filter -> { + filter.getMappings().stream().filter(filterMappingInfo -> filterMappingInfo.getDispatcher().contains(request.getDispatcherType())) + .forEach(mappingInfo -> { + if (mappingInfo.getMappingType() == FilterMappingType.URL) { + if (PathMatcherUtil.matches(request.getRequestURI(), contextPath.length(), mappingInfo.getServletUrlMapping()) > -1) { + filters.add(filter.getFilter()); + } + } else if (mappingInfo.getMappingType() == FilterMappingType.SERVLET) { + if (handlerContext.getServletInfo() != null && StringUtils.equals(mappingInfo.getServletNameMapping(), handlerContext.getServletInfo().getServlet().getServletConfig().getServletName())) { + filters.add(filter.getFilter()); + } + } else { + throw new IllegalStateException(); } - } else { - throw new IllegalStateException(); - } - }); + }); + }); return filters; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/Handler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/Handler.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/Handler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/Handler.java index f0ae8d55adee82cecbb758d7a5cb304487c17c04..6a0c2786fe09da74320713a11a9399f965a321c8 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/Handler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/Handler.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; +package tech.smartboot.jakarta.handler; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/HandlerContext.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/HandlerContext.java similarity index 88% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/HandlerContext.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/HandlerContext.java index 3adc8548d9ad308011d2f74ecfc5de78046c9cce..5a8b0e7be0169fbbf1c17cf2922cc9e7151c99cd 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/HandlerContext.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/HandlerContext.java @@ -8,14 +8,14 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; +package tech.smartboot.jakarta.handler; -import org.smartboot.servlet.SmartHttpServletRequest; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.impl.ServletContextImpl; +import tech.smartboot.jakarta.SmartHttpServletRequest; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.impl.ServletContextImpl; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; /** * 请求处理上下文对象 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/HandlerPipeline.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/HandlerPipeline.java similarity index 94% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/HandlerPipeline.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/HandlerPipeline.java index dfbf7f8600ed488bff585cfbb310a217ad259e34..6c9450764df8429d997fd34f33385c9b0252ecdb 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/HandlerPipeline.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/HandlerPipeline.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; +package tech.smartboot.jakarta.handler; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/ServletMatchHandler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletMatchHandler.java similarity index 51% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/ServletMatchHandler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletMatchHandler.java index 91b5a72616e86b6afae9882a7f528402d59156a4..a14db0a5f0d56969239e265243ccda786f5626a1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/ServletMatchHandler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletMatchHandler.java @@ -8,17 +8,17 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; +package tech.smartboot.jakarta.handler; -import org.smartboot.servlet.SmartHttpServletRequest; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.conf.ServletMappingInfo; -import org.smartboot.servlet.exception.WrappedRuntimeException; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.util.PathMatcherUtil; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.MappingMatch; +import tech.smartboot.jakarta.SmartHttpServletRequest; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.conf.ServletMappingInfo; +import tech.smartboot.jakarta.exception.WrappedRuntimeException; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.util.PathMatcherUtil; -import javax.servlet.Servlet; -import javax.servlet.ServletException; import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -57,46 +57,58 @@ public class ServletMatchHandler extends Handler { request.setServletPath(cacheServlet.servletPathStart, cacheServlet.servletPathEnd); request.setPathInfo(cacheServlet.pathInfoStart, cacheServlet.pathInfoEnd); } + if (handlerContext.getServletInfo() != null) { + doNext(handlerContext); + return; + } //匹配Servlet - if (handlerContext.getServletInfo() == null) { - Servlet servlet = null; - for (Map.Entry entry : servletInfoMap.entrySet()) { - final ServletInfo servletInfo = entry.getValue(); - if (!servletInfo.initialized()) { - servletInfo.init(handlerContext.getServletContext()); + ServletMappingInfo preMatchMapping = null; + for (Map.Entry entry : servletInfoMap.entrySet()) { + final ServletInfo servletInfo = entry.getValue(); + if (!servletInfo.initialized()) { + servletInfo.init(handlerContext.getServletContext()); + } + if (ServletInfo.DEFAULT_SERVLET_NAME.equals(servletInfo.getServletName())) { + continue; + } + for (ServletMappingInfo path : servletInfo.getMappings()) { + int servletPathEnd = PathMatcherUtil.matches(request.getRequestURI(), contextPath.length(), path); + //匹配失败 + if (servletPathEnd < 0) { + continue; } - if (ServletInfo.DEFAULT_SERVLET_NAME.equals(servletInfo.getServletName())) { + //筛选匹配度更高的mapping + if (preMatchMapping != null && preMatchMapping.getMapping().length() > path.getMapping().length()) { continue; } - for (ServletMappingInfo path : servletInfo.getMappings()) { - int servletPathEnd = PathMatcherUtil.matches(request.getRequestURI(), contextPath.length(), path); - //匹配失败 - if (servletPathEnd < 0) { - continue; - } - servlet = servletInfo.getServlet(); - //《Servlet3.1规范中文版》3.5请求路径元素 - int servletPathStart = request.getContextPath().length(); - int pathInfoStart; - int pathInfoEnd; - if (servletPathEnd == 0) { - //精确匹配和后缀匹配的 PathInfo 都为null - servletPathEnd = servletPathStart; - } - if (servletPathEnd == request.getRequestURI().length()) { - pathInfoStart = pathInfoEnd = -1; - } else { - pathInfoStart = servletPathEnd; - pathInfoEnd = request.getRequestURI().length(); - } - request.setServletPath(servletPathStart, servletPathEnd); - request.setPathInfo(pathInfoStart, pathInfoEnd); - cacheServletMap.put(request.getRequestURI(), new CacheServlet(servletInfo, servletPathStart, servletPathEnd, pathInfoStart, pathInfoEnd)); - break; + preMatchMapping = path; + handlerContext.setServletInfo(servletInfo); + + //《Servlet3.1规范中文版》3.5请求路径元素 + int servletPathStart = request.getContextPath().length(); + int pathInfoStart; + int pathInfoEnd; + if (servletPathEnd == 0) { + //精确匹配和后缀匹配的 PathInfo 都为null + servletPathEnd = servletPathStart; + } + if (servletPathEnd == request.getRequestURI().length()) { + pathInfoStart = pathInfoEnd = -1; + } else { + pathInfoStart = servletPathEnd; + pathInfoEnd = request.getRequestURI().length(); } - if (servlet != null) { + request.setServletPath(servletPathStart, servletPathEnd); + request.setPathInfo(pathInfoStart, pathInfoEnd); + + request.setServletMappingInfo(path); + + cacheServletMap.put(request.getRequestURI(), new CacheServlet(servletInfo, servletPathStart, servletPathEnd, pathInfoStart, pathInfoEnd)); + //精准匹配,直接完成 + if (path.getMappingType() == MappingMatch.EXACT && !path.getMapping().equals("/")) { handlerContext.setServletInfo(servletInfo); - break; + doNext(handlerContext); + return; } } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/ServletRequestListenerHandler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletRequestListenerHandler.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/ServletRequestListenerHandler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletRequestListenerHandler.java index 06bae1fff65c4f96d18bf2c5c9abd6f33397c994..14da0ffb75fdf69ebbd081066cd8e1ada4b885ed 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/ServletRequestListenerHandler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletRequestListenerHandler.java @@ -8,15 +8,16 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; +package tech.smartboot.jakarta.handler; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequestEvent; +import jakarta.servlet.ServletRequestListener; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequestEvent; -import javax.servlet.ServletRequestListener; import java.io.IOException; import java.util.List; @@ -29,6 +30,10 @@ public class ServletRequestListenerHandler extends Handler { @Override public void handleRequest(HandlerContext handlerContext) throws ServletException, IOException { + if (handlerContext.getRequest().getDispatcherType() != DispatcherType.REQUEST) { + doNext(handlerContext); + return; + } ServletContext servletContext = handlerContext.getServletContext(); List servletRequestListeners = handlerContext.getServletContext().getDeploymentInfo().getServletRequestListeners(); ServletRequestEvent servletRequestEvent = servletRequestListeners.isEmpty() ? null : new ServletRequestEvent(servletContext, handlerContext.getRequest()); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/handler/ServletServiceHandler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletServiceHandler.java similarity index 73% rename from servlet-core/src/main/java/org/smartboot/servlet/handler/ServletServiceHandler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletServiceHandler.java index c5513f6dc5508e549eeb5a225f3e9f532eff8ab1..288d1702e7a7a1522feddbe4eb9b67386a448f00 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/handler/ServletServiceHandler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/handler/ServletServiceHandler.java @@ -8,13 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.handler; +package tech.smartboot.jakarta.handler; -import org.smartboot.servlet.conf.ServletInfo; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import tech.smartboot.jakarta.conf.ServletInfo; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; import java.io.IOException; /** @@ -33,7 +33,8 @@ public class ServletServiceHandler extends Handler { if (handlerContext.getServletInfo() != null) { handlerContext.getServletInfo().getServlet().service(request, response); } else { - handlerContext.getServletContext().getServlet(ServletInfo.DEFAULT_SERVLET_NAME).service(request, response); + handlerContext.getServletContext().getDeploymentInfo().getServlets().get(ServletInfo.DEFAULT_SERVLET_NAME).getServlet().service(request, response); } + } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ApplicationFilterRegistration.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ApplicationFilterRegistration.java similarity index 66% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ApplicationFilterRegistration.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ApplicationFilterRegistration.java index 0484872d14f0cbd0f4e6c76ccce67eaebd793e66..214d7cf21ee0d6121dda6ea1538b191442493b7c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ApplicationFilterRegistration.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ApplicationFilterRegistration.java @@ -8,16 +8,15 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import org.smartboot.servlet.conf.DeploymentInfo; -import org.smartboot.servlet.conf.FilterInfo; -import org.smartboot.servlet.conf.FilterMappingInfo; -import org.smartboot.servlet.enums.FilterMappingType; -import org.smartboot.servlet.util.PathMatcherUtil; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.FilterRegistration; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.FilterMappingInfo; +import tech.smartboot.jakarta.enums.FilterMappingType; +import tech.smartboot.jakarta.util.PathMatcherUtil; -import javax.servlet.DispatcherType; -import javax.servlet.FilterRegistration; import java.util.Collection; import java.util.EnumSet; import java.util.HashMap; @@ -30,50 +29,39 @@ import java.util.stream.Collectors; * @author 三刀 * @version V1.0 , 2020/11/14 */ -public class ApplicationFilterRegistration - implements FilterRegistration.Dynamic { +public class ApplicationFilterRegistration implements FilterRegistration.Dynamic { private final FilterInfo filterDef; - private final DeploymentInfo context; - public ApplicationFilterRegistration(FilterInfo filterDef, DeploymentInfo context) { + public ApplicationFilterRegistration(FilterInfo filterDef) { this.filterDef = filterDef; - this.context = context; } @Override - public void addMappingForServletNames( - EnumSet dispatcherTypes, boolean isMatchAfter, - String... servletNames) { + public void addMappingForServletNames(EnumSet dispatcherTypes, boolean isMatchAfter, String... servletNames) { for (String servletName : servletNames) { FilterMappingInfo mappingInfo = new FilterMappingInfo(filterDef.getFilterName(), FilterMappingType.SERVLET, servletName, null, dispatcherTypes); - context.addFilterMapping(mappingInfo); + filterDef.addMapping(mappingInfo); } } @Override - public void addMappingForUrlPatterns( - EnumSet dispatcherTypes, boolean isMatchAfter, - String... urlPatterns) { + public void addMappingForUrlPatterns(EnumSet dispatcherTypes, boolean isMatchAfter, String... urlPatterns) { for (String urlPattern : urlPatterns) { FilterMappingInfo mappingInfo = new FilterMappingInfo(filterDef.getFilterName(), FilterMappingType.URL, null, PathMatcherUtil.addMapping(urlPattern), dispatcherTypes); - context.addFilterMapping(mappingInfo); + filterDef.addMapping(mappingInfo); } } @Override public Collection getServletNameMappings() { - return context.getFilterMappings().stream() - .filter(filterMappingInfo -> filterMappingInfo.getMappingType() == FilterMappingType.SERVLET) - .map(FilterMappingInfo::getServletNameMapping).collect(Collectors.toList()); + return filterDef.getMappings().stream().filter(filterMappingInfo -> filterMappingInfo.getMappingType() == FilterMappingType.SERVLET).map(FilterMappingInfo::getServletNameMapping).collect(Collectors.toList()); } @Override public Collection getUrlPatternMappings() { - return context.getFilterMappings().stream() - .filter(filterMappingInfo -> filterMappingInfo.getMappingType() == FilterMappingType.SERVLET) - .map(FilterMappingInfo::getServletNameMapping).collect(Collectors.toList()); + return filterDef.getMappings().stream().filter(filterMappingInfo -> filterMappingInfo.getMappingType() == FilterMappingType.URL).map(filterMappingInfo -> filterMappingInfo.getServletUrlMapping().getMapping()).collect(Collectors.toList()); } @Override diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ApplicationServletRegistration.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ApplicationServletRegistration.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ApplicationServletRegistration.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ApplicationServletRegistration.java index c87100be68755209575a475a81f065458c87f75a..540e7a9437aa0eb4b078cfe7ff57c94aa79e1922 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ApplicationServletRegistration.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ApplicationServletRegistration.java @@ -8,17 +8,17 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; -import org.smartboot.servlet.conf.DeploymentInfo; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.conf.ServletMappingInfo; +import tech.smartboot.jakarta.conf.DeploymentInfo; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.conf.ServletMappingInfo; -import javax.servlet.MultipartConfigElement; -import javax.servlet.ServletRegistration; -import javax.servlet.ServletSecurityElement; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.ServletRegistration; +import jakarta.servlet.ServletSecurityElement; import java.util.Arrays; import java.util.Collection; import java.util.Collections; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/FilterConfigImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/FilterConfigImpl.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/FilterConfigImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/FilterConfigImpl.java index 041138c2b554e24f59ba4364a7acef32ac5fae2e..d174009be4b4e097381063ccbee2f1811a15bea0 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/FilterConfigImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/FilterConfigImpl.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import org.smartboot.servlet.conf.FilterInfo; +import tech.smartboot.jakarta.conf.FilterInfo; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletContext; import java.util.Collections; import java.util.Enumeration; diff --git a/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletMappingImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletMappingImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..d867cc86fac94acd3f828b12755edbe83c258237 --- /dev/null +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletMappingImpl.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ + +package tech.smartboot.jakarta.impl; + +import jakarta.servlet.http.HttpServletMapping; +import jakarta.servlet.http.MappingMatch; + +public class HttpServletMappingImpl implements HttpServletMapping { + private MappingMatch mappingMatch; + private String matchValue; + private String servletName; + private String pattern; + + public HttpServletMappingImpl(MappingMatch mappingMatch, String matchValue, String servletName, String pattern) { + this.mappingMatch = mappingMatch; + this.matchValue = matchValue; + this.servletName = servletName; + this.pattern = pattern; + } + + @Override + public String getMatchValue() { + return matchValue; + } + + @Override + public String getPattern() { + return pattern; + } + + @Override + public String getServletName() { + return servletName; + } + + @Override + public MappingMatch getMappingMatch() { + return mappingMatch; + } +} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/HttpServletRequestImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletRequestImpl.java similarity index 85% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/HttpServletRequestImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletRequestImpl.java index 3a21fc5f9eb9256d08b24f7edfd52b1c10a1a9f2..d12bf2ea753bd19df34a642432d501fa6affc526 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/HttpServletRequestImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletRequestImpl.java @@ -8,42 +8,45 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; - +package tech.smartboot.jakarta.impl; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.MultipartConfigElement; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletConnection; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletRequestAttributeEvent; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletMapping; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpUpgradeHandler; +import jakarta.servlet.http.Part; import org.smartboot.http.common.enums.HeaderNameEnum; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; import org.smartboot.http.common.utils.NumberUtils; import org.smartboot.http.common.utils.StringUtils; import org.smartboot.http.server.HttpRequest; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.SmartHttpServletRequest; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.impl.fileupload.SmartHttpRequestContext; -import org.smartboot.servlet.provider.SessionProvider; -import org.smartboot.servlet.third.commons.fileupload.FileItem; -import org.smartboot.servlet.third.commons.fileupload.FileUpload; -import org.smartboot.servlet.third.commons.fileupload.FileUploadException; -import org.smartboot.servlet.third.commons.fileupload.disk.DiskFileItemFactory; -import org.smartboot.servlet.util.CollectionUtils; -import org.smartboot.servlet.util.DateUtil; import org.smartboot.socket.util.Attachment; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.SmartHttpServletRequest; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.conf.ServletMappingInfo; +import tech.smartboot.jakarta.impl.fileupload.SmartHttpRequestContext; +import tech.smartboot.jakarta.provider.SessionProvider; +import tech.smartboot.jakarta.third.commons.fileupload.FileItem; +import tech.smartboot.jakarta.third.commons.fileupload.FileUpload; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadException; +import tech.smartboot.jakarta.third.commons.fileupload.disk.DiskFileItemFactory; +import tech.smartboot.jakarta.util.CollectionUtils; +import tech.smartboot.jakarta.util.DateUtil; -import javax.servlet.AsyncContext; -import javax.servlet.DispatcherType; -import javax.servlet.MultipartConfigElement; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletRequest; -import javax.servlet.ServletRequestAttributeEvent; -import javax.servlet.ServletResponse; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpUpgradeHandler; -import javax.servlet.http.Part; import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -111,6 +114,8 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { private volatile AsyncContext asyncContext = null; private final CompletableFuture completableFuture; + private ServletMappingInfo servletMappingInfo; + public HttpServletRequestImpl(HttpRequest request, ServletContextRuntime runtime, DispatcherType dispatcherType, CompletableFuture completableFuture) { this.request = request; this.dispatcherType = dispatcherType; @@ -234,7 +239,7 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { @Override public String getPathTranslated() { - return getRealPath(getPathInfo()); + return servletContext.getRealPath(getPathInfo()); } @Override @@ -361,10 +366,6 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { return getRequestedSessionId() != null && !sessionIdFromCookie; } - @Override - public boolean isRequestedSessionIdFromUrl() { - return isRequestedSessionIdFromURL(); - } @Override public boolean authenticate(HttpServletResponse response) { @@ -372,8 +373,47 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { } @Override - public void login(String username, String password) { - throw new UnsupportedOperationException(); + public void login(String username, String password) throws ServletException { + throw new ServletException("Not Implemented"); + } + + @Override + public HttpServletMapping getHttpServletMapping() { + if (servletMappingInfo == null) { + return null; + } + String matchValue; + switch (servletMappingInfo.getMappingType()) { + case EXACT: + matchValue = servletMappingInfo.getMapping(); + if (matchValue.startsWith("/")) { + matchValue = matchValue.substring(1); + } + break; + case DEFAULT: + case CONTEXT_ROOT: + matchValue = ""; + break; + case PATH: + matchValue = + getServletPath().substring(servletMappingInfo.getMapping().length() - 1); + if (matchValue.startsWith("/")) { + matchValue = matchValue.substring(1); + } + break; + case EXTENSION: + matchValue = + getServletPath().substring(getServletPath().charAt(0) == '/' ? 1 : 0, + getServletPath().length() - servletMappingInfo.getMapping().length() + 1); + break; + default: + throw new IllegalStateException(); + } + return new HttpServletMappingImpl(servletMappingInfo.getMappingType(), matchValue, servletMappingInfo.getServletInfo().getServletName(), servletMappingInfo.getMapping()); + } + + public void setServletMappingInfo(ServletMappingInfo servletMappingInfo) { + this.servletMappingInfo = servletMappingInfo; } @Override @@ -641,10 +681,11 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { Object replace = attributes.put(name, o); if (CollectionUtils.isNotEmpty(runtime.getDeploymentInfo().getRequestAttributeListeners())) { - ServletRequestAttributeEvent event = new ServletRequestAttributeEvent(servletContext, this, name, o); if (replace == null) { + ServletRequestAttributeEvent event = new ServletRequestAttributeEvent(servletContext, this, name, o); runtime.getDeploymentInfo().getRequestAttributeListeners().forEach(request -> request.attributeAdded(event)); } else { + ServletRequestAttributeEvent event = new ServletRequestAttributeEvent(servletContext, this, name, replace); runtime.getDeploymentInfo().getRequestAttributeListeners().forEach(request -> request.attributeReplaced(event)); } } @@ -682,10 +723,6 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { return runtime.getDispatcherProvider().getRequestDispatcher(this, path); } - @Override - public String getRealPath(String path) { - return servletContext.getRealPath(path); - } @Override public int getRemotePort() { @@ -772,6 +809,21 @@ public class HttpServletRequestImpl implements SmartHttpServletRequest { return dispatcherType; } + @Override + public String getRequestId() { + return ""; + } + + @Override + public String getProtocolRequestId() { + return ""; + } + + @Override + public ServletConnection getServletConnection() { + return null; + } + public CompletableFuture getCompletableFuture() { return completableFuture; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/HttpServletResponseImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletResponseImpl.java similarity index 94% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/HttpServletResponseImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletResponseImpl.java index 7a4845c0c159c139c628631516185b0380cf4093..f712f997c33d084a62479e2183da82fb7ff6fa18 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/HttpServletResponseImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/HttpServletResponseImpl.java @@ -8,24 +8,26 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletResponse; import org.smartboot.http.common.enums.HeaderNameEnum; import org.smartboot.http.common.enums.HttpStatus; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; import org.smartboot.http.common.utils.StringUtils; import org.smartboot.http.server.HttpResponse; -import org.smartboot.servlet.util.DateUtil; -import org.smartboot.servlet.util.PathMatcherUtil; +import tech.smartboot.jakarta.util.DateUtil; +import tech.smartboot.jakarta.util.PathMatcherUtil; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Locale; +import java.util.Map; +import java.util.function.Supplier; /** * @author 三刀 @@ -58,17 +60,14 @@ public class HttpServletResponseImpl implements HttpServletResponse { sessionCookie.setDomain(cookie.getDomain()); sessionCookie.setMaxAge(cookie.getMaxAge()); sessionCookie.setSecure(cookie.getSecure()); - sessionCookie.setVersion(cookie.getVersion()); return; } org.smartboot.http.common.Cookie httpCookie = new org.smartboot.http.common.Cookie(cookie.getName(), cookie.getValue()); - httpCookie.setComment(cookie.getComment()); httpCookie.setDomain(cookie.getDomain()); httpCookie.setHttpOnly(cookie.isHttpOnly()); httpCookie.setPath(cookie.getPath()); httpCookie.setMaxAge(cookie.getMaxAge()); httpCookie.setSecure(cookie.getSecure()); - httpCookie.setVersion(cookie.getVersion()); response.addCookie(httpCookie); if (cookie.getName().equals(request.getServletContext().getSessionCookieConfig().getName())) { sessionCookie = httpCookie; @@ -92,16 +91,6 @@ public class HttpServletResponseImpl implements HttpServletResponse { } - @Override - public String encodeUrl(String url) { - return encodeURL(url); - } - - @Override - public String encodeRedirectUrl(String url) { - return encodeURL(url); - } - @Override public void sendError(int sc, String msg) throws IOException { //If the response has already been committed, this method throws an IllegalStateException. @@ -182,10 +171,6 @@ public class HttpServletResponseImpl implements HttpServletResponse { response.addHeader(name, String.valueOf(value)); } - @Override - public void setStatus(int sc, String sm) { - throw new UnsupportedOperationException(); - } @Override public int getStatus() { @@ -383,4 +368,14 @@ public class HttpServletResponseImpl implements HttpServletResponse { } setHeader(HeaderNameEnum.CONTENT_LANGUAGE.getName(), loc.getLanguage() + "-" + loc.getCountry()); } + + @Override + public void setTrailerFields(Supplier> supplier) { + response.setTrailerFields(supplier); + } + + @Override + public Supplier> getTrailerFields() { + return response.getTrailerFields(); + } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/JspConfigDescriptorImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/JspConfigDescriptorImpl.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/JspConfigDescriptorImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/JspConfigDescriptorImpl.java index aa69d99e0adaee5b22fe16f02a288c841e9345ab..c2c1a547c035e6dbb0bb5a3d4f61aa3cf7bc2c65 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/JspConfigDescriptorImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/JspConfigDescriptorImpl.java @@ -8,11 +8,11 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import javax.servlet.descriptor.JspConfigDescriptor; -import javax.servlet.descriptor.JspPropertyGroupDescriptor; -import javax.servlet.descriptor.TaglibDescriptor; +import jakarta.servlet.descriptor.JspConfigDescriptor; +import jakarta.servlet.descriptor.JspPropertyGroupDescriptor; +import jakarta.servlet.descriptor.TaglibDescriptor; import java.util.ArrayList; import java.util.Collection; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/PartImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/PartImpl.java similarity index 95% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/PartImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/PartImpl.java index 5243d59cb5ba40f3e88b34e8625757c91d9063e1..a9fab5eebe8123feed7e6f788c598fa27fe219e0 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/PartImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/PartImpl.java @@ -8,13 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import org.smartboot.servlet.third.commons.fileupload.FileItem; -import org.smartboot.servlet.third.commons.fileupload.ParameterParser; -import org.smartboot.servlet.third.commons.fileupload.disk.DiskFileItem; +import tech.smartboot.jakarta.third.commons.fileupload.FileItem; +import tech.smartboot.jakarta.third.commons.fileupload.ParameterParser; +import tech.smartboot.jakarta.third.commons.fileupload.disk.DiskFileItem; -import javax.servlet.http.Part; +import jakarta.servlet.http.Part; import java.io.File; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletConfigImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletConfigImpl.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ServletConfigImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletConfigImpl.java index 30f8687624cc4a66189b1574964e8c1674da036e..bed74c1bbde6dca5eefc76b6292f64d3877016bf 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletConfigImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletConfigImpl.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import org.smartboot.servlet.conf.ServletInfo; +import tech.smartboot.jakarta.conf.ServletInfo; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; import java.util.Collections; import java.util.Enumeration; /** diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletContextImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletContextImpl.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ServletContextImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletContextImpl.java index 56e163ae11bc773adeeb7e03293874be2f0a79af..6a079cd6e09241312dbc5bcaeb6e5a3a1056cd4b 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletContextImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletContextImpl.java @@ -8,38 +8,38 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; - +package tech.smartboot.jakarta.impl; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextAttributeEvent; +import jakarta.servlet.ServletContextAttributeListener; +import jakarta.servlet.ServletContextListener; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration; +import jakarta.servlet.ServletRequestAttributeListener; +import jakarta.servlet.ServletRequestListener; +import jakarta.servlet.SessionCookieConfig; +import jakarta.servlet.SessionTrackingMode; +import jakarta.servlet.descriptor.JspConfigDescriptor; +import jakarta.servlet.http.HttpSessionAttributeListener; +import jakarta.servlet.http.HttpSessionIdListener; +import jakarta.servlet.http.HttpSessionListener; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; import org.smartboot.http.common.utils.Mimetypes; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.conf.DeploymentInfo; -import org.smartboot.servlet.conf.FilterInfo; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.enums.ServletContextPathType; -import org.smartboot.servlet.exception.WrappedRuntimeException; -import org.smartboot.servlet.handler.HandlerPipeline; - -import javax.servlet.Filter; -import javax.servlet.FilterRegistration; -import javax.servlet.RequestDispatcher; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextAttributeEvent; -import javax.servlet.ServletContextAttributeListener; -import javax.servlet.ServletContextListener; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration; -import javax.servlet.ServletRequestAttributeListener; -import javax.servlet.ServletRequestListener; -import javax.servlet.SessionCookieConfig; -import javax.servlet.SessionTrackingMode; -import javax.servlet.descriptor.JspConfigDescriptor; -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionIdListener; -import javax.servlet.http.HttpSessionListener; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.conf.DeploymentInfo; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.enums.ServletContextPathType; +import tech.smartboot.jakarta.exception.WrappedRuntimeException; +import tech.smartboot.jakarta.handler.HandlerPipeline; + import java.io.File; import java.io.InputStream; import java.net.MalformedURLException; @@ -57,7 +57,6 @@ import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import java.util.stream.Collectors; /** * @author 三刀 @@ -120,8 +119,7 @@ public class ServletContextImpl implements ServletContext { @Override public int getEffectiveMajorVersion() { - checkContextInitializeState(); - return 5; + return 6; } @Override @@ -250,31 +248,12 @@ public class ServletContextImpl implements ServletContext { return runtime.getDispatcherProvider().getNamedDispatcher(this, name); } - @Override - public Servlet getServlet(String name) throws ServletException { - ServletInfo servletInfo = deploymentInfo.getServlets().get(name); - return servletInfo == null ? null : servletInfo.getServlet(); - } - - @Override - public Enumeration getServlets() { - return Collections.enumeration(deploymentInfo.getServlets().values().stream().map(ServletInfo::getServlet).collect(Collectors.toList())); - } - - @Override - public Enumeration getServletNames() { - return Collections.enumeration(deploymentInfo.getServlets().keySet()); - } @Override public void log(String msg) { LOGGER.info(msg); } - @Override - public void log(Exception exception, String msg) { - LOGGER.info(msg, exception); - } @Override public void log(String message, Throwable throwable) { @@ -304,6 +283,9 @@ public class ServletContextImpl implements ServletContext { @Override public String getInitParameter(String name) { + if (name == null) { + throw new NullPointerException(); + } return deploymentInfo.getInitParameters().get(name); } @@ -314,6 +296,9 @@ public class ServletContextImpl implements ServletContext { @Override public boolean setInitParameter(String name, String value) { + if (name == null) { + throw new NullPointerException(); + } checkContextInitializeState(); if (deploymentInfo.getInitParameters().containsKey(name)) { return false; @@ -383,6 +368,9 @@ public class ServletContextImpl implements ServletContext { public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) { checkServletContextState(); checkContextInitializeState(); + if (StringUtils.isBlank(servletName)) { + throw new IllegalArgumentException("servletName is null"); + } if (deploymentInfo.getServlets().containsKey(servletName)) { return null; @@ -407,7 +395,9 @@ public class ServletContextImpl implements ServletContext { @Override public ServletRegistration.Dynamic addJspFile(String servletName, String jspFile) { - return null; + ServletRegistration.Dynamic registration = addServlet(servletName, "org.apache.jasper.servlet.JspServlet"); + registration.setInitParameter("jspFile", jspFile); + return registration; } @Override @@ -461,7 +451,7 @@ public class ServletContextImpl implements ServletContext { filterInfo.setFilterClass(filter.getClass().getName()); filterInfo.setDynamic(true); deploymentInfo.addFilter(filterInfo); - return new ApplicationFilterRegistration(filterInfo, deploymentInfo); + return new ApplicationFilterRegistration(filterInfo); } private void checkServletContextState() { @@ -488,14 +478,14 @@ public class ServletContextImpl implements ServletContext { public FilterRegistration getFilterRegistration(String filterName) { checkContextInitializeState(); FilterInfo filterInfo = deploymentInfo.getFilters().get(filterName); - return new ApplicationFilterRegistration(filterInfo, deploymentInfo); + return new ApplicationFilterRegistration(filterInfo); } @Override public Map getFilterRegistrations() { checkContextInitializeState(); Map filterMap = new HashMap<>(); - deploymentInfo.getFilters().forEach((filterName, filterInfo) -> filterMap.put(filterName, new ApplicationFilterRegistration(filterInfo, deploymentInfo))); + deploymentInfo.getFilters().forEach((filterName, filterInfo) -> filterMap.put(filterName, new ApplicationFilterRegistration(filterInfo))); return filterMap; } @@ -647,6 +637,8 @@ public class ServletContextImpl implements ServletContext { @Override public void setSessionTimeout(int sessionTimeout) { + checkServletContextState(); + checkContextInitializeState(); deploymentInfo.setSessionTimeout(sessionTimeout); } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletContextWrapperListener.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletContextWrapperListener.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ServletContextWrapperListener.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletContextWrapperListener.java index 013aa2d28fafd43b794b22956b0e0cc1feb53b23..b3812172f480eebf46fe65e0c4852cf240a33cbb 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletContextWrapperListener.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletContextWrapperListener.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextListener; public class ServletContextWrapperListener { private final ServletContextListener listener; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletInputStreamImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletInputStreamImpl.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ServletInputStreamImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletInputStreamImpl.java index eba58fa2ebce53f7fb328bcaf470cf557d8ae493..591734d89b679f63007f9a6d723d4228eb877608 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletInputStreamImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletInputStreamImpl.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import javax.servlet.ReadListener; -import javax.servlet.ServletInputStream; +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletOutputStreamImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletOutputStreamImpl.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ServletOutputStreamImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletOutputStreamImpl.java index aadd37256685410fe645d5562ba55946533af494..3cb5e36c47d26061e85b2be53668ae726d94aec5 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletOutputStreamImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletOutputStreamImpl.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; import org.smartboot.http.common.BufferOutputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.WriteListener; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.WriteListener; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletPrintWriter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletPrintWriter.java similarity index 98% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/ServletPrintWriter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletPrintWriter.java index af63bd1d9a4f6b942fce7a3cf178bb92e1aafbd9..fb64c775a6a4a07066fb20cefb58579077b24135 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/ServletPrintWriter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/ServletPrintWriter.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/SessionCookieConfigImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/SessionCookieConfigImpl.java similarity index 83% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/SessionCookieConfigImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/SessionCookieConfigImpl.java index 1a02411b16867a719c0b923378a7c7bd7160520f..2ebdf3bb84b27aa66a89359ff09c3c36af444984 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/SessionCookieConfigImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/SessionCookieConfigImpl.java @@ -8,11 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl; +package tech.smartboot.jakarta.impl; -import javax.servlet.SessionCookieConfig; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.provider.SessionProvider; +import jakarta.servlet.SessionCookieConfig; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.provider.SessionProvider; + +import java.util.Map; /** * @author 三刀 @@ -109,6 +111,21 @@ public class SessionCookieConfigImpl implements SessionCookieConfig { return maxAge; } + @Override + public void setAttribute(String name, String value) { + + } + + @Override + public String getAttribute(String name) { + return ""; + } + + @Override + public Map getAttributes() { + return Map.of(); + } + @Override public void setMaxAge(int maxAge) { check(); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/impl/fileupload/SmartHttpRequestContext.java b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/fileupload/SmartHttpRequestContext.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/impl/fileupload/SmartHttpRequestContext.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/impl/fileupload/SmartHttpRequestContext.java index d89d5912352475fd32f407678ed4b2364156a656..825e579a8a6908174b34294b0fafda3399eb9e74 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/impl/fileupload/SmartHttpRequestContext.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/impl/fileupload/SmartHttpRequestContext.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.impl.fileupload; +package tech.smartboot.jakarta.impl.fileupload; -import org.smartboot.servlet.third.commons.fileupload.FileUploadBase; -import org.smartboot.servlet.third.commons.fileupload.UploadContext; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadBase; +import tech.smartboot.jakarta.third.commons.fileupload.UploadContext; import org.smartboot.http.server.HttpRequest; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/Plugin.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/Plugin.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/Plugin.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/Plugin.java index c1de2514db0b280308fcf6cd2231c6bf0fea1e70..0a6f51c5bae68970787a33ea5b75e6954d378645 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/Plugin.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/Plugin.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins; +package tech.smartboot.jakarta.plugins; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; -import org.smartboot.servlet.Container; -import org.smartboot.servlet.ServletContextRuntime; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.ServletContextRuntime; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/PluginException.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/PluginException.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/PluginException.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/PluginException.java index f8e31a69027ce2dcf71a4ec107c3e59277d5bc24..fbd0b188bf20998ae35a009bba837b01acfb1cad 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/PluginException.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/PluginException.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins; +package tech.smartboot.jakarta.plugins; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextImpl.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextImpl.java index 74691bd57575930493dfb420f6213d351f64e008..f2bd233720c0ed7cd0ca31429fb4f612c740231f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextImpl.java @@ -8,32 +8,32 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.async; +package tech.smartboot.jakarta.plugins.async; import org.smartboot.http.common.enums.HttpStatus; import org.smartboot.http.common.utils.HttpUtils; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.exception.WrappedRuntimeException; -import org.smartboot.servlet.handler.HandlerContext; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.impl.HttpServletResponseImpl; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.plugins.dispatcher.ServletRequestDispatcherWrapper; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.exception.WrappedRuntimeException; +import tech.smartboot.jakarta.handler.HandlerContext; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.HttpServletResponseImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.plugins.dispatcher.ServletRequestDispatcherWrapper; import org.smartboot.socket.timer.HashedWheelTimer; import org.smartboot.socket.timer.TimerTask; -import javax.servlet.AsyncContext; -import javax.servlet.AsyncEvent; -import javax.servlet.AsyncListener; -import javax.servlet.DispatcherType; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.ServletResponseWrapper; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.AsyncEvent; +import jakarta.servlet.AsyncListener; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.ServletResponseWrapper; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.HashMap; import java.util.LinkedList; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextPlugin.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextPlugin.java similarity index 80% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextPlugin.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextPlugin.java index 635d6b7ac65cd8d2b5ab1ab96e34703f8600065f..5d8afb02edf89c6b065dcdb6ef488b64f34ab726 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextPlugin.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextPlugin.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.async; +package tech.smartboot.jakarta.plugins.async; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.plugins.Plugin; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.plugins.Plugin; public class AsyncContextPlugin extends Plugin { @Override diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextProviderImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextProviderImpl.java similarity index 75% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextProviderImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextProviderImpl.java index d46483af40f6b0fa65dad377ffd97bac7159b259..20024193ff80e459e53e02966a966dfab45c2d8c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/async/AsyncContextProviderImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/async/AsyncContextProviderImpl.java @@ -8,14 +8,14 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.async; +package tech.smartboot.jakarta.plugins.async; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.provider.AsyncContextProvider; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.provider.AsyncContextProvider; -import javax.servlet.AsyncContext; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; public class AsyncContextProviderImpl implements AsyncContextProvider { @Override diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/contact/ContactPlugin.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/contact/ContactPlugin.java similarity index 86% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/contact/ContactPlugin.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/contact/ContactPlugin.java index 392761e935f5bb22c5996600500df847ed1ed55d..74a80c14d8e37f0919eeda623deabb1b013b1377 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/contact/ContactPlugin.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/contact/ContactPlugin.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.contact; +package tech.smartboot.jakarta.plugins.contact; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.plugins.Plugin; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.plugins.Plugin; /** * 联系方式插件 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/DispatcherPlugin.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/DispatcherPlugin.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/DispatcherPlugin.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/DispatcherPlugin.java index 66f689ab81e23ff44aa1dff87a06ac6d60834984..fa44f4e5440a419b65bb97533ca084a30d7829ac 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/DispatcherPlugin.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/DispatcherPlugin.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.dispatcher; +package tech.smartboot.jakarta.plugins.dispatcher; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.plugins.Plugin; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.plugins.Plugin; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/DispatcherProviderImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/DispatcherProviderImpl.java similarity index 83% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/DispatcherProviderImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/DispatcherProviderImpl.java index a7539b4b96621835209200c680d153838e175545..a8a5de1240969f44445bd13b86884149f7a425ba 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/DispatcherProviderImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/DispatcherProviderImpl.java @@ -8,19 +8,19 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.dispatcher; +package tech.smartboot.jakarta.plugins.dispatcher; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.provider.DispatcherProvider; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.provider.DispatcherProvider; -import javax.servlet.DispatcherType; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/RequestDispatcherImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/RequestDispatcherImpl.java similarity index 88% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/RequestDispatcherImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/RequestDispatcherImpl.java index a5201754ee025f76f3c1ab5ae5c6d73cd71fd08b..cd0881d2fe1c626061da8d8e59d1d50bd0df5941 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/RequestDispatcherImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/RequestDispatcherImpl.java @@ -8,23 +8,23 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.dispatcher; - +package tech.smartboot.jakarta.plugins.dispatcher; + +import jakarta.servlet.DispatcherType; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletRequestWrapper; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.ServletResponseWrapper; import org.smartboot.http.common.utils.HttpUtils; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.handler.HandlerContext; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.impl.HttpServletResponseImpl; -import org.smartboot.servlet.impl.ServletContextImpl; - -import javax.servlet.DispatcherType; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletRequestWrapper; -import javax.servlet.ServletResponse; -import javax.servlet.ServletResponseWrapper; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.handler.HandlerContext; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.HttpServletResponseImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; + import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -150,6 +150,14 @@ class RequestDispatcherImpl implements RequestDispatcher { } String[] array = StringUtils.split(dispatcherURL, "?"); requestWrapper.setRequestUri(array[0]); + if (array.length > 1) { + Map parameters = new HashMap<>(); + HttpUtils.decodeParamString(array[1], parameters); + requestWrapper.setParameters(parameters); + requestWrapper.setQueryString(array[1]); + } + } else { + requestWrapper.setParameters(request.getParameterMap()); } HandlerContext handlerContext = new HandlerContext(requestWrapper, responseWrapper, servletContext, named); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/ServletRequestDispatcherWrapper.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/ServletRequestDispatcherWrapper.java similarity index 85% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/ServletRequestDispatcherWrapper.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/ServletRequestDispatcherWrapper.java index 7c3d2eccd446f75b9c15668f0daa832c2e74d3e2..140914b05454358c2fe92bbc5a261b2217129459 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/ServletRequestDispatcherWrapper.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/ServletRequestDispatcherWrapper.java @@ -8,15 +8,17 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.dispatcher; +package tech.smartboot.jakarta.plugins.dispatcher; -import org.smartboot.servlet.SmartHttpServletRequest; -import org.smartboot.servlet.conf.ServletInfo; -import org.smartboot.servlet.impl.HttpServletRequestImpl; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.http.HttpServletMapping; +import jakarta.servlet.http.HttpServletRequestWrapper; import org.smartboot.socket.util.Attachment; +import tech.smartboot.jakarta.SmartHttpServletRequest; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.conf.ServletMappingInfo; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; -import javax.servlet.DispatcherType; -import javax.servlet.http.HttpServletRequestWrapper; import java.util.Collections; import java.util.Enumeration; import java.util.Map; @@ -141,6 +143,16 @@ public class ServletRequestDispatcherWrapper extends HttpServletRequestWrapper i request.setAttachment(attachment); } + @Override + public void setServletMappingInfo(ServletMappingInfo httpServletMapping) { + this.request.setServletMappingInfo(httpServletMapping); + } + + @Override + public HttpServletMapping getHttpServletMapping() { + return this.request.getHttpServletMapping(); + } + @Override public String getServletPath() { if (named) { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/ServletResponseDispatcherWrapper.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/ServletResponseDispatcherWrapper.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/ServletResponseDispatcherWrapper.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/ServletResponseDispatcherWrapper.java index 6713e2003c96ebdec4582c06c9085f1de18962b1..422201e8bbefaddba8062bc4ec83cb5c55712af1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/dispatcher/ServletResponseDispatcherWrapper.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/dispatcher/ServletResponseDispatcherWrapper.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.dispatcher; +package tech.smartboot.jakarta.plugins.dispatcher; -import org.smartboot.servlet.impl.HttpServletResponseImpl; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletResponseWrapper; +import tech.smartboot.jakarta.impl.HttpServletResponseImpl; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponseWrapper; import java.io.IOException; import java.util.Locale; @@ -118,13 +118,6 @@ class ServletResponseDispatcherWrapper extends HttpServletResponseWrapper { super.setStatus(sc); } - @Override - public void setStatus(int sc, String sm) { - if (included) { - return; - } - super.setStatus(sc, sm); - } @Override public void setCharacterEncoding(String charset) { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/session/HttpSessionImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/HttpSessionImpl.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/session/HttpSessionImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/HttpSessionImpl.java index 7e2081df7c1cc2eb99d162220bd8fdb924901d6b..d4ef77c8fd9f39732ba2483a35de79d2e5acdd68 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/session/HttpSessionImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/HttpSessionImpl.java @@ -8,24 +8,23 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.session; - +package tech.smartboot.jakarta.plugins.session; + +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSessionBindingEvent; +import jakarta.servlet.http.HttpSessionBindingListener; +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionIdListener; +import jakarta.servlet.http.HttpSessionListener; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.util.CollectionUtils; import org.smartboot.socket.timer.TimerTask; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.util.CollectionUtils; -import javax.servlet.ServletContext; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionBindingEvent; -import javax.servlet.http.HttpSessionBindingListener; -import javax.servlet.http.HttpSessionContext; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionIdListener; -import javax.servlet.http.HttpSessionListener; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; @@ -112,10 +111,6 @@ class HttpSessionImpl implements HttpSession { }, maxInactiveInterval, TimeUnit.SECONDS); } - @Override - public HttpSessionContext getSessionContext() { - return sessionProvider; - } @Override public Object getAttribute(String name) { @@ -123,11 +118,6 @@ class HttpSessionImpl implements HttpSession { return attributes.get(name); } - @Override - public Object getValue(String name) { - checkState(); - return getAttribute(name); - } @Override public Enumeration getAttributeNames() { @@ -135,11 +125,6 @@ class HttpSessionImpl implements HttpSession { return Collections.enumeration(attributes.keySet()); } - @Override - public String[] getValueNames() { - checkState(); - return attributes.keySet().toArray(new String[0]); - } @Override public void setAttribute(String name, Object value) { @@ -166,11 +151,6 @@ class HttpSessionImpl implements HttpSession { } } - @Override - public void putValue(String name, Object value) { - checkState(); - setAttribute(name, value); - } @Override public void removeAttribute(String name) { @@ -185,11 +165,6 @@ class HttpSessionImpl implements HttpSession { } } - @Override - public void removeValue(String name) { - checkState(); - removeAttribute(name); - } @Override public void invalidate() { @@ -200,7 +175,9 @@ class HttpSessionImpl implements HttpSession { public void invalid() { List sessionListeners = servletContext.getDeploymentInfo().getHttpSessionListeners(); HttpSessionEvent httpSessionEvent = sessionListeners.isEmpty() ? null : new HttpSessionEvent(this); - sessionListeners.forEach(httpSessionListener -> httpSessionListener.sessionDestroyed(httpSessionEvent)); + for (int i = sessionListeners.size() - 1; i >= 0; i--) { + sessionListeners.get(i).sessionDestroyed(httpSessionEvent); + } invalid = true; Cookie cookie = new Cookie(servletContext.getSessionCookieConfig().getName(), sessionId); cookie.setMaxAge(0); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/session/SessionPlugin.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/SessionPlugin.java similarity index 82% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/session/SessionPlugin.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/SessionPlugin.java index 4cdd8c3a155f63195b276c063626f2a885e2b5b6..c78b6f4e1f7532a42dbf61354c053615bae5d80f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/session/SessionPlugin.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/SessionPlugin.java @@ -8,11 +8,11 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.session; +package tech.smartboot.jakarta.plugins.session; -import org.smartboot.servlet.Container; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.plugins.Plugin; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.plugins.Plugin; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/session/SessionProviderImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/SessionProviderImpl.java similarity index 86% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/session/SessionProviderImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/SessionProviderImpl.java index 1045619712dd25e73803bd5ab1f9c977b3b23153..1dbea4d2d8d99014d88e6949f8b010c36e456c5c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/session/SessionProviderImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/session/SessionProviderImpl.java @@ -8,22 +8,19 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.session; +package tech.smartboot.jakarta.plugins.session; +import jakarta.servlet.SessionCookieConfig; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.smartboot.http.common.logging.Logger; import org.smartboot.http.common.logging.LoggerFactory; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.provider.SessionProvider; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.provider.SessionProvider; import org.smartboot.socket.timer.HashedWheelTimer; -import javax.servlet.SessionCookieConfig; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionContext; import java.text.SimpleDateFormat; -import java.util.Collections; -import java.util.Enumeration; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; @@ -32,7 +29,7 @@ import java.util.function.Function; * @author 三刀 * @version V1.0 , 2019/12/21 */ -class SessionProviderImpl implements SessionProvider, HttpSessionContext { +class SessionProviderImpl implements SessionProvider { private static final Logger LOGGER = LoggerFactory.getLogger(SessionProviderImpl.class); private Function sessionIdFactory = request -> "smart-servlet:" + new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis()); @@ -51,16 +48,6 @@ class SessionProviderImpl implements SessionProvider, HttpSessionContext { private final HashedWheelTimer timer = new HashedWheelTimer(r -> new Thread(r, "smartboot-session-timer"), 10, 64); - @Override - public HttpSession getSession(String sessionId) { - return sessionMap.get(sessionId); - } - - @Override - public Enumeration getIds() { - return Collections.enumeration(sessionMap.keySet()); - } - @Override public HttpSessionImpl getSession(HttpServletRequestImpl request, HttpServletResponse response, boolean create) { @@ -88,7 +75,6 @@ class SessionProviderImpl implements SessionProvider, HttpSessionContext { SessionCookieConfig sessionCookieConfig = request.getServletContext().getSessionCookieConfig(); Cookie cookie = new Cookie(sessionCookieConfig.getName(), httpSession.getId()); cookie.setPath(request.getRequestURI()); - cookie.setComment(sessionCookieConfig.getComment()); if (sessionCookieConfig.getDomain() != null) { cookie.setDomain(sessionCookieConfig.getDomain()); } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebSocketFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebSocketFilter.java similarity index 64% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebSocketFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebSocketFilter.java index 07206c14f85268c75bf7d30308174848100c0767..e99647de8a21982e7c0fd4cb15c85d4d4cf64a53 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebSocketFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebSocketFilter.java @@ -1,21 +1,30 @@ -package org.smartboot.servlet.plugins.websocket; +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ +package tech.smartboot.jakarta.plugins.websocket; + +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.websocket.server.ServerContainer; import org.smartboot.http.common.enums.HeaderNameEnum; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.plugins.websocket.impl.AnnotatedEndpoint; -import org.smartboot.servlet.plugins.websocket.impl.PathNode; -import org.smartboot.servlet.plugins.websocket.impl.SmartServerEndpointConfig; -import org.smartboot.servlet.plugins.websocket.impl.WebSocketServerContainerImpl; +import tech.smartboot.jakarta.plugins.websocket.impl.PathNode; +import tech.smartboot.jakarta.plugins.websocket.impl.SmartServerEndpointConfig; +import tech.smartboot.jakarta.plugins.websocket.impl.WebSocketServerContainerImpl; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.websocket.server.ServerContainer; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -57,8 +66,7 @@ public class WebSocketFilter implements Filter { } //匹配成功 if (matched) { - AnnotatedEndpoint endpoint = new AnnotatedEndpoint(serverEndpointConfig, matchData); - container.doUpgrade(req, resp, serverEndpointConfig.getServerEndpointConfig(), endpoint, matchData); + container.upgradeHttpToWebSocket(req, resp, serverEndpointConfig.getServerEndpointConfig(), matchData); return; } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebsocketPlugin.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebsocketPlugin.java similarity index 65% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebsocketPlugin.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebsocketPlugin.java index 387e0fec7d282084ede3fda3e304cfe97dae193b..f56bdbc6a32b5aff07f346e16eb6cc3d612dc304 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebsocketPlugin.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebsocketPlugin.java @@ -8,17 +8,17 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket; +package tech.smartboot.jakarta.plugins.websocket; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.conf.FilterInfo; -import org.smartboot.servlet.conf.FilterMappingInfo; -import org.smartboot.servlet.enums.FilterMappingType; -import org.smartboot.servlet.plugins.Plugin; -import org.smartboot.servlet.util.PathMatcherUtil; +import jakarta.servlet.DispatcherType; +import jakarta.websocket.server.ServerContainer; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.conf.FilterInfo; +import tech.smartboot.jakarta.conf.FilterMappingInfo; +import tech.smartboot.jakarta.enums.FilterMappingType; +import tech.smartboot.jakarta.plugins.Plugin; +import tech.smartboot.jakarta.util.PathMatcherUtil; -import javax.servlet.DispatcherType; -import javax.websocket.server.ServerContainer; import java.util.Collections; /** @@ -38,7 +38,8 @@ public class WebsocketPlugin extends Plugin { filterInfo.setFilterName("wsFilter"); filterInfo.setFilterClass(WebSocketFilter.class.getName()); containerRuntime.getDeploymentInfo().addFilter(filterInfo); - containerRuntime.getDeploymentInfo().addFilterMapping(new FilterMappingInfo(filterInfo.getFilterName(), FilterMappingType.URL, null, PathMatcherUtil.addMapping("/*"), Collections.singleton(DispatcherType.REQUEST))); + filterInfo.addMapping(new FilterMappingInfo(filterInfo.getFilterName(), + FilterMappingType.URL, null, PathMatcherUtil.addMapping("/*"), Collections.singleton(DispatcherType.REQUEST))); } @Override diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebsocketProviderImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebsocketProviderImpl.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebsocketProviderImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebsocketProviderImpl.java index aa4fbb7b35d1626549ca4c09da80c6680e5a9d40..c8e4dddef9e7293c4f8337596b049c203f3a8d73 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/WebsocketProviderImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/WebsocketProviderImpl.java @@ -8,21 +8,21 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket; +package tech.smartboot.jakarta.plugins.websocket; +import jakarta.websocket.CloseReason; +import jakarta.websocket.PongMessage; +import jakarta.websocket.server.ServerContainer; import org.smartboot.http.common.utils.WebSocketUtil; import org.smartboot.http.server.WebSocketRequest; import org.smartboot.http.server.WebSocketResponse; import org.smartboot.http.server.impl.WebSocketRequestImpl; -import org.smartboot.servlet.WebSocketServerContainer; -import org.smartboot.servlet.plugins.websocket.impl.HandlerWrapper; -import org.smartboot.servlet.plugins.websocket.impl.WebSocketServerContainerImpl; -import org.smartboot.servlet.plugins.websocket.impl.WebsocketSession; -import org.smartboot.servlet.provider.WebsocketProvider; +import tech.smartboot.jakarta.plugins.websocket.impl.HandlerWrapper; +import tech.smartboot.jakarta.plugins.websocket.impl.WebSocketServerContainerImpl; +import tech.smartboot.jakarta.plugins.websocket.impl.WebsocketSession; +import tech.smartboot.jakarta.provider.WebsocketProvider; import org.smartboot.socket.util.Attachment; -import javax.websocket.CloseReason; -import javax.websocket.PongMessage; import java.nio.charset.StandardCharsets; /** @@ -34,7 +34,7 @@ public class WebsocketProviderImpl implements WebsocketProvider { private final WebSocketServerContainerImpl serverContainer = new WebSocketServerContainerImpl(); @Override - public WebSocketServerContainer getWebSocketServerContainer() { + public ServerContainer getWebSocketServerContainer() { return serverContainer; } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/AnnotatedEndpoint.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/AnnotatedEndpoint.java similarity index 94% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/AnnotatedEndpoint.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/AnnotatedEndpoint.java index 51eda5141867dfe8bf6bfc5ce300a59626bf49ad..84786bfa5044480c2401b55fbb8ab5b7cc9aba4e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/AnnotatedEndpoint.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/AnnotatedEndpoint.java @@ -8,13 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; +package tech.smartboot.jakarta.plugins.websocket.impl; -import javax.websocket.CloseReason; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; -import javax.websocket.Session; -import javax.websocket.server.PathParam; +import jakarta.websocket.CloseReason; +import jakarta.websocket.Endpoint; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.Session; +import jakarta.websocket.server.PathParam; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandlerWrapper.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandlerWrapper.java similarity index 94% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandlerWrapper.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandlerWrapper.java index e2bb99a93cc2f8381947a608fdf5c8ba76109cfd..ee8a4b0af1f25536aa57d04e7ce7593f835f18d4 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandlerWrapper.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandlerWrapper.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; +package tech.smartboot.jakarta.plugins.websocket.impl; -import javax.websocket.MessageHandler; +import jakarta.websocket.MessageHandler; /** * @author 三刀(zhengjunweimail@163.com) diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandshakeRequestImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandshakeRequestImpl.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandshakeRequestImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandshakeRequestImpl.java index cdbdf440595f53e4143dd094f0e333e122522e2d..8258d045fb41b024968569cc86a0ee6d073e2129 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/HandshakeRequestImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandshakeRequestImpl.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; +package tech.smartboot.jakarta.plugins.websocket.impl; -import javax.servlet.http.HttpServletRequest; -import javax.websocket.server.HandshakeRequest; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.websocket.server.HandshakeRequest; import java.net.URI; import java.security.Principal; import java.util.Arrays; diff --git a/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandshakeResponseImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandshakeResponseImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..a3959fa01e7d89feea39eb095f887a416507a49a --- /dev/null +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/HandshakeResponseImpl.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ + +package tech.smartboot.jakarta.plugins.websocket.impl; + +import jakarta.servlet.http.HttpServletResponse; +import jakarta.websocket.HandshakeResponse; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class HandshakeResponseImpl implements HandshakeResponse { + public HandshakeResponseImpl(HttpServletResponse response) { + + } + + @Override + public Map> getHeaders() { + return Collections.emptyMap(); + } +} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/OnMessageConfig.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/OnMessageConfig.java similarity index 95% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/OnMessageConfig.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/OnMessageConfig.java index 7c3a082bff79238643bc4fcdb07295e9c95675ad..4f7563af3eab5720074b23e1228baa1171cbb0c8 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/OnMessageConfig.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/OnMessageConfig.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; +package tech.smartboot.jakarta.plugins.websocket.impl; import java.lang.annotation.Annotation; import java.lang.reflect.Method; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/PathNode.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/PathNode.java similarity index 97% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/PathNode.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/PathNode.java index 2ddf5029e3285aca65ca792445155bb235ea8310..8a4f15f74ee47c80479ef81d095ed952865f6eab 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/PathNode.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/PathNode.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; +package tech.smartboot.jakarta.plugins.websocket.impl; import java.util.ArrayList; import java.util.List; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/SmartServerEndpointConfig.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/SmartServerEndpointConfig.java similarity index 95% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/SmartServerEndpointConfig.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/SmartServerEndpointConfig.java index 44d85d8e5f898990c241efd7bd740878fdbca0ed..790d4edbf11c4befa1d5f1c44b10397c0564c1ad 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/SmartServerEndpointConfig.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/SmartServerEndpointConfig.java @@ -8,14 +8,14 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; - -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.PongMessage; -import javax.websocket.server.ServerEndpointConfig; +package tech.smartboot.jakarta.plugins.websocket.impl; + +import jakarta.websocket.OnClose; +import jakarta.websocket.OnError; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.PongMessage; +import jakarta.websocket.server.ServerEndpointConfig; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.ArrayList; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WebSocketServerContainerImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WebSocketServerContainerImpl.java similarity index 76% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WebSocketServerContainerImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WebSocketServerContainerImpl.java index 390dc80fb2651a521baf1bb13a5023a80f7dccb5..144954fd403c82a8951939ee6f6a0bc4acfe597c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WebSocketServerContainerImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WebSocketServerContainerImpl.java @@ -8,28 +8,28 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; - -import org.smartboot.servlet.WebSocketServerContainer; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.provider.WebsocketProvider; +package tech.smartboot.jakarta.plugins.websocket.impl; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerContainer; +import jakarta.websocket.server.ServerEndpoint; +import jakarta.websocket.server.ServerEndpointConfig; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.provider.WebsocketProvider; import org.smartboot.socket.util.Attachment; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; -import javax.websocket.server.ServerEndpointConfig; import java.io.IOException; import java.net.URI; -import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -39,9 +39,10 @@ import java.util.Set; * @author 三刀(zhengjunweimail@163.com) * @version V1.0 , 2021/3/28 */ -public class WebSocketServerContainerImpl implements WebSocketServerContainer { +public class WebSocketServerContainerImpl implements ServerContainer { private final Set> endpointClassSet = new HashSet<>(); - private final List endpointConfigs = new ArrayList<>(); + private final Map endpointConfigs = + new HashMap<>(); private boolean deployed = false; private final List installedExtensions = Collections.emptyList(); @@ -70,7 +71,30 @@ public class WebSocketServerContainerImpl implements WebSocketServerContainer { if (deployed) { throw new DeploymentException(""); } - endpointConfigs.add(new SmartServerEndpointConfig(serverConfig)); + endpointConfigs.put(serverConfig, new SmartServerEndpointConfig(serverConfig)); + } + + @Override + public void upgradeHttpToWebSocket(Object httpServletRequest, Object httpServletResponse, ServerEndpointConfig sec, Map pathParameters) { + HttpServletRequest request = (HttpServletRequest) httpServletRequest; + HttpServletResponse response = (HttpServletResponse) httpServletResponse; + + HandshakeRequestImpl handshakeRequest = new HandshakeRequestImpl(request); + HandshakeResponseImpl handshakeResponse = new HandshakeResponseImpl(response); + ServerEndpointConfig.Configurator c = sec.getConfigurator(); + c.modifyHandshake(sec, handshakeRequest, handshakeResponse); + + HttpServletRequestImpl req = (HttpServletRequestImpl) request; + Attachment attachment = req.getAttachment(); + if (attachment == null) { + attachment = new Attachment(); + req.setAttachment(attachment); + } + SmartServerEndpointConfig endpointConfig = endpointConfigs.get(sec); + AnnotatedEndpoint endpoint = new AnnotatedEndpoint(endpointConfig, pathParameters); + WebsocketSession websocketSession = new WebsocketSession(this, endpoint, URI.create(request.getRequestURI())); + attachment.put(WebsocketProvider.WEBSOCKET_SESSION_ATTACH_KEY, websocketSession); + endpoint.onOpen(websocketSession, sec); } @Override @@ -142,26 +166,8 @@ public class WebSocketServerContainerImpl implements WebSocketServerContainer { deployed = true; } - public List getEndpointConfigs() { - return endpointConfigs; + public Collection getEndpointConfigs() { + return endpointConfigs.values(); } - @Override - public void doUpgrade(HttpServletRequest request, HttpServletResponse response, final ServerEndpointConfig sec, Endpoint endpoint, Map pathParams) throws ServletException, IOException { - HandshakeRequestImpl handshakeRequest = new HandshakeRequestImpl(request); - HandshakeResponseImpl handshakeResponse = new HandshakeResponseImpl(response); - ServerEndpointConfig.Configurator c = sec.getConfigurator(); - c.modifyHandshake(sec, handshakeRequest, handshakeResponse); - - HttpServletRequestImpl req = (HttpServletRequestImpl) request; - Attachment attachment = req.getAttachment(); - if (attachment == null) { - attachment = new Attachment(); - req.setAttachment(attachment); - } - - WebsocketSession websocketSession = new WebsocketSession(this, endpoint, URI.create(request.getRequestURI())); - attachment.put(WebsocketProvider.WEBSOCKET_SESSION_ATTACH_KEY, websocketSession); - endpoint.onOpen(websocketSession, sec); - } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WebsocketSession.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WebsocketSession.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WebsocketSession.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WebsocketSession.java index 45024ec325e29085baf63a549b1f4e262c2e9384..1a9b3c99fd8dbebc47a5cb995967466a380f79d1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WebsocketSession.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WebsocketSession.java @@ -8,16 +8,16 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.plugins.websocket.impl; - -import javax.websocket.CloseReason; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import javax.websocket.MessageHandler; -import javax.websocket.PongMessage; -import javax.websocket.RemoteEndpoint; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; +package tech.smartboot.jakarta.plugins.websocket.impl; + +import jakarta.websocket.CloseReason; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.PongMessage; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.Session; +import jakarta.websocket.WebSocketContainer; import java.io.IOException; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WholeMessageHandler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WholeMessageHandler.java similarity index 75% rename from servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WholeMessageHandler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WholeMessageHandler.java index f2238af2a9467158f276b972c4d8870900e1ac2f..98fb4ef38cd83aff34dc761a657eaaf8bbec68f4 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/plugins/websocket/impl/WholeMessageHandler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/plugins/websocket/impl/WholeMessageHandler.java @@ -1,8 +1,18 @@ -package org.smartboot.servlet.plugins.websocket.impl; +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ -import javax.websocket.MessageHandler; -import javax.websocket.Session; -import javax.websocket.server.PathParam; +package tech.smartboot.jakarta.plugins.websocket.impl; + +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; +import jakarta.websocket.server.PathParam; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/AsyncContextProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/AsyncContextProvider.java similarity index 73% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/AsyncContextProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/AsyncContextProvider.java index 090747c044bbd494f67ad16173e32ee43aac307a..2bcebe090b1a94a0ed714a8702904fb594b38c29 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/AsyncContextProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/AsyncContextProvider.java @@ -8,13 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; -import org.smartboot.servlet.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; -import javax.servlet.AsyncContext; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; public interface AsyncContextProvider { AsyncContext startAsync(HttpServletRequestImpl request, ServletRequest servletRequest, ServletResponse servletResponse, AsyncContext asyncContext) throws IllegalStateException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/DispatcherProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/DispatcherProvider.java similarity index 75% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/DispatcherProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/DispatcherProvider.java index 7cb3945376e8287f3225b651afa89b2822ab1d02..f0ccbd845e57ee325c16f5d81bb6c02375a81a04 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/DispatcherProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/DispatcherProvider.java @@ -8,14 +8,14 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.impl.ServletContextImpl; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; -import javax.servlet.RequestDispatcher; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/FaviconProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/FaviconProvider.java similarity index 83% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/FaviconProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/FaviconProvider.java index bf3264ebc7d69877bb6aee7c3c9b1f8396ec79bf..9f21f46758743b990a0d1267d21586dbd576440f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/FaviconProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/FaviconProvider.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; -import org.smartboot.servlet.ServletContextRuntime; +import tech.smartboot.jakarta.ServletContextRuntime; public interface FaviconProvider { void resister(ServletContextRuntime runtime); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/SecurityProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/SecurityProvider.java similarity index 82% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/SecurityProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/SecurityProvider.java index 4c1ab00c04d1b39268ff1188f78e2a210955cb7c..6f0d3152ae069354a9fb2a48fe0363c5b39c7ee1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/SecurityProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/SecurityProvider.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; -import org.smartboot.servlet.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; public interface SecurityProvider { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/SessionProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/SessionProvider.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/SessionProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/SessionProvider.java index 8ccafedbd62691803590cf6523ae9f2f9a153a94..ed4771cedc44341c68783fd541f455ae3e88cf2d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/SessionProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/SessionProvider.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; -import org.smartboot.servlet.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import java.util.function.Function; /** diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/VendorProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/VendorProvider.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/VendorProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/VendorProvider.java index 58719f584e32feb464c03150c4dfbaebf9d80d7c..267278d3aae38963d37d026fabb9f1a5afd97ccc 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/VendorProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/VendorProvider.java @@ -8,9 +8,9 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; public interface VendorProvider { void signature(HttpServletResponse response); diff --git a/servlet-core/src/main/java/org/smartboot/servlet/provider/WebsocketProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/WebsocketProvider.java similarity index 78% rename from servlet-core/src/main/java/org/smartboot/servlet/provider/WebsocketProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/provider/WebsocketProvider.java index 7f80eb77191f11d5fd32027f9029c100ea8cd511..c158e650ecebab333f9749d770e74dd5820cd991 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/provider/WebsocketProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/provider/WebsocketProvider.java @@ -8,14 +8,15 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.provider; +package tech.smartboot.jakarta.provider; +import jakarta.websocket.server.ServerContainer; import org.smartboot.http.server.WebSocketRequest; import org.smartboot.http.server.WebSocketResponse; -import org.smartboot.servlet.WebSocketServerContainer; +import tech.smartboot.jakarta.WebSocketServerContainer; import org.smartboot.socket.util.AttachKey; -import javax.websocket.Session; +import jakarta.websocket.Session; /** * @author 三刀(zhengjunweimail@163.com) @@ -24,7 +25,7 @@ import javax.websocket.Session; public interface WebsocketProvider { AttachKey WEBSOCKET_SESSION_ATTACH_KEY = AttachKey.valueOf("websocketSession"); - WebSocketServerContainer getWebSocketServerContainer(); + ServerContainer getWebSocketServerContainer(); void doHandle(WebSocketRequest request, WebSocketResponse response); } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockAsyncContextProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockAsyncContextProvider.java similarity index 69% rename from servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockAsyncContextProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockAsyncContextProvider.java index 417fa0dd858537eb856566acbb7dd1606f6e71da..c1680ec1efcdd0b283b6063541379423721d0c6c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockAsyncContextProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockAsyncContextProvider.java @@ -8,15 +8,15 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.sandbox; +package tech.smartboot.jakarta.sandbox; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.plugins.PluginException; -import org.smartboot.servlet.provider.AsyncContextProvider; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.plugins.PluginException; +import tech.smartboot.jakarta.provider.AsyncContextProvider; -import javax.servlet.AsyncContext; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.AsyncContext; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; public class MockAsyncContextProvider implements AsyncContextProvider { @Override diff --git a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockDispatcherProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockDispatcherProvider.java similarity index 77% rename from servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockDispatcherProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockDispatcherProvider.java index c607c2d09f5d8179eac884de13af25ba80872c17..8bdc004f78f73a4c770100e6bd49d792dd555c21 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockDispatcherProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockDispatcherProvider.java @@ -8,16 +8,16 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.sandbox; +package tech.smartboot.jakarta.sandbox; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.smartboot.servlet.impl.ServletContextImpl; -import org.smartboot.servlet.plugins.PluginException; -import org.smartboot.servlet.provider.DispatcherProvider; +import tech.smartboot.jakarta.impl.HttpServletRequestImpl; +import tech.smartboot.jakarta.impl.ServletContextImpl; +import tech.smartboot.jakarta.plugins.PluginException; +import tech.smartboot.jakarta.provider.DispatcherProvider; -import javax.servlet.RequestDispatcher; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * @author 三刀 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockFaviconProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockFaviconProvider.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockFaviconProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockFaviconProvider.java index 15d54b991649414d7797d41be9d08a1396bec2b0..4aaa3826d354794a75619b334cff8bc855107c32 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockFaviconProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockFaviconProvider.java @@ -8,20 +8,20 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.sandbox; +package tech.smartboot.jakarta.sandbox; import org.smartboot.http.common.enums.HeaderNameEnum; import org.smartboot.http.common.enums.HttpMethodEnum; import org.smartboot.http.common.enums.HttpStatus; import org.smartboot.http.common.utils.StringUtils; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.provider.FaviconProvider; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.provider.FaviconProvider; -import javax.servlet.ServletException; -import javax.servlet.ServletRegistration; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.text.ParseException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockVendorProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockVendorProvider.java similarity index 86% rename from servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockVendorProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockVendorProvider.java index 26da42ead81a4bd711f26a547ecc7868e65cd0c1..3975bf34d4ef7e066f604558b1e6f3173219d00a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockVendorProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockVendorProvider.java @@ -8,12 +8,12 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.sandbox; +package tech.smartboot.jakarta.sandbox; -import org.smartboot.servlet.Container; -import org.smartboot.servlet.provider.VendorProvider; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.provider.VendorProvider; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; public class MockVendorProvider implements VendorProvider { @Override diff --git a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockWebsocketProvider.java b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockWebsocketProvider.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockWebsocketProvider.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockWebsocketProvider.java index 19d0927d4193327851470c5132b4ce7f4acccaa2..684ff8cfb07c093f48155f64bd8a39f4c213f4ce 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/MockWebsocketProvider.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/MockWebsocketProvider.java @@ -8,23 +8,20 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.sandbox; - +package tech.smartboot.jakarta.sandbox; + +import jakarta.websocket.ClientEndpointConfig; +import jakarta.websocket.DeploymentException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Extension; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpointConfig; import org.smartboot.http.server.WebSocketRequest; import org.smartboot.http.server.WebSocketResponse; -import org.smartboot.servlet.WebSocketServerContainer; -import org.smartboot.servlet.plugins.PluginException; -import org.smartboot.servlet.provider.WebsocketProvider; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.websocket.ClientEndpointConfig; -import javax.websocket.DeploymentException; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpointConfig; +import tech.smartboot.jakarta.WebSocketServerContainer; +import tech.smartboot.jakarta.plugins.PluginException; +import tech.smartboot.jakarta.provider.WebsocketProvider; + import java.io.IOException; import java.net.URI; import java.util.Collections; @@ -40,10 +37,6 @@ public class MockWebsocketProvider implements WebsocketProvider { @Override public WebSocketServerContainer getWebSocketServerContainer() { return new WebSocketServerContainer() { - @Override - public void doUpgrade(HttpServletRequest request, HttpServletResponse response, ServerEndpointConfig sec, Endpoint endpoint, Map pathParams) throws ServletException, IOException { - throw new PluginException(SandBox.UPGRADE_MESSAGE_ZH); - } @Override public void addEndpoint(Class endpointClass) throws DeploymentException { @@ -55,6 +48,11 @@ public class MockWebsocketProvider implements WebsocketProvider { } + @Override + public void upgradeHttpToWebSocket(Object o, Object o1, ServerEndpointConfig serverEndpointConfig, Map map) throws IOException, DeploymentException { + throw new PluginException(SandBox.UPGRADE_MESSAGE_ZH); + } + @Override public long getDefaultAsyncSendTimeout() { return 0; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/SandBox.java b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/SandBox.java similarity index 82% rename from servlet-core/src/main/java/org/smartboot/servlet/sandbox/SandBox.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/SandBox.java index 038db67385adb10957791aaf009dd0f8370ee532..c71a08bd678f09ec84eef90ef6058fadb8414fe8 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/sandbox/SandBox.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/sandbox/SandBox.java @@ -8,13 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.sandbox; +package tech.smartboot.jakarta.sandbox; -import org.smartboot.servlet.provider.AsyncContextProvider; -import org.smartboot.servlet.provider.DispatcherProvider; -import org.smartboot.servlet.provider.FaviconProvider; -import org.smartboot.servlet.provider.VendorProvider; -import org.smartboot.servlet.provider.WebsocketProvider; +import tech.smartboot.jakarta.provider.AsyncContextProvider; +import tech.smartboot.jakarta.provider.DispatcherProvider; +import tech.smartboot.jakarta.provider.FaviconProvider; +import tech.smartboot.jakarta.provider.VendorProvider; +import tech.smartboot.jakarta.provider.WebsocketProvider; /** * 沙箱环境 diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/Const.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/Const.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/Const.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/Const.java index 4140a1a8344f2251ce92c7bb10ef4958815e2ce0..1029a88c62de04ff820c4d399cdae22190a062a9 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/Const.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/Const.java @@ -1,21 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel; +package tech.smartboot.jakarta.third.bcel; /** * Constants for the project, mostly defined in the JVM specification. diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/AnnotationElementValue.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/AnnotationElementValue.java similarity index 48% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/AnnotationElementValue.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/AnnotationElementValue.java index 1422a8be1a912c8041c6ed3e96a2333410b04636..25240d87d1f56f74abdb3bcf9e176d5884291b7d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/AnnotationElementValue.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/AnnotationElementValue.java @@ -1,21 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; public class AnnotationElementValue extends ElementValue { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/AnnotationEntry.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/AnnotationEntry.java similarity index 61% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/AnnotationEntry.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/AnnotationEntry.java index 5b3443fdc2bd9fd4969859121b6f8d89f96bd452..68d089f9bce87665f974f5599a6c9772425f6972 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/AnnotationEntry.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/AnnotationEntry.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Annotations.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Annotations.java similarity index 50% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Annotations.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Annotations.java index 5cd61fd0ecc663b026806896ba246b460b77c7ec..93a71f5a5603fef44c0e9b4a2466f553685fcca7 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Annotations.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Annotations.java @@ -1,21 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ArrayElementValue.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ArrayElementValue.java similarity index 53% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ArrayElementValue.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ArrayElementValue.java index ffc7158352e240d44b8de84032b2a88bda0e3b2f..da7711ca5d59ad9607e32285d596e6b0b3aa69be 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ArrayElementValue.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ArrayElementValue.java @@ -1,21 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; public class ArrayElementValue extends ElementValue { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassElementValue.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassElementValue.java similarity index 40% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassElementValue.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassElementValue.java index 8bc8a98b0498c1b9ca79aa35d0218c36c7eda365..355fb88ddab606eb73e1ea0153123b2500a820c6 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassElementValue.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassElementValue.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; public class ClassElementValue extends ElementValue { diff --git a/spring-boot-starter/src/main/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassFormatException.java similarity index 45% rename from spring-boot-starter/src/main/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassFormatException.java index 42a939f3c77412ea6c18d6a5a83f33e95a969e5f..a5018800a7b6b2cef8a9fee1245a3d96178055b4 100644 --- a/spring-boot-starter/src/main/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassFormatException.java @@ -7,11 +7,23 @@ * and legally in accordance with the AGPL-3.0 open source agreement * without special permission from the smartboot organization. */ - -package org.apache.tomcat.websocket.server; +package tech.smartboot.jakarta.third.bcel.classfile; /** - * 不要删除该类,兼容spring 2 + * Thrown when the BCEL attempts to read a class file and determines + * that the file is malformed or otherwise cannot be interpreted as a + * class file. */ -public class WsHttpUpgradeHandler { +public class ClassFormatException extends RuntimeException { + + private static final long serialVersionUID = 3243149520175287759L; + + public ClassFormatException() { + super(); + } + + + public ClassFormatException(final String s) { + super(s); + } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassParser.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassParser.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassParser.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassParser.java index e0ce45c7e39dacbda140fa342ea3df9e3994c0f7..4a531b8be7d9df9073562ed1ffb641b7b9eea6bb 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ClassParser.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ClassParser.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.BufferedInputStream; import java.io.DataInput; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Constant.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Constant.java similarity index 77% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Constant.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Constant.java index 0bb102a257048eb1cf42b3ddffa1459ea379140b..4ea0d66affc53b302a2d817f0293b79553b7ccc3 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Constant.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Constant.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantClass.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantClass.java similarity index 49% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantClass.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantClass.java index d0254e6888f6ed110d0940e72999916d8f609419..5cd7f2cde3de5a922a2cd47f4984d26b891e376f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantClass.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantClass.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantDouble.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantDouble.java similarity index 43% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantDouble.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantDouble.java index 9438010b5dc7a28816734d912a1e458e694e29bd..44f4275576c6aa72de8e56d6894f4758aeabe93f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantDouble.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantDouble.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantFloat.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantFloat.java similarity index 43% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantFloat.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantFloat.java index c4fe6e2df192929f4f0950c2b49616fafa20cf8d..d1d3713edc16f61e52d91395bfaa40cccc7ff7ee 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantFloat.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantFloat.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantInteger.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantInteger.java similarity index 43% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantInteger.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantInteger.java index 0a0926dd0884880e2ce321d66404e42f588f248e..6adb3169b76af0dd95c4ae8ccdf64d5554d98e09 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantInteger.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantInteger.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantLong.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantLong.java similarity index 42% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantLong.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantLong.java index 4840035772f89efcbb748776994f15285935a638..791597d40d91a7caa6d353caf880e1dd57ca41d0 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantLong.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantLong.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantPool.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantPool.java similarity index 77% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantPool.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantPool.java index 7c31748adb4d203a679cf6d6bcb569a1e13399da..cd57517e263b454dfba124f55308e79787e07297 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantPool.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantPool.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantUtf8.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantUtf8.java similarity index 50% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantUtf8.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantUtf8.java index 2188a6e67f1869aaace46190143c0b7ae6b57145..710284482402410f63634dfb36f373037e1032e8 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ConstantUtf8.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ConstantUtf8.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ElementValue.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ElementValue.java similarity index 76% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ElementValue.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ElementValue.java index f8d08478656402a25372c16015bc2338c50e84ef..a65b9b060d7637a7291087407824f92756c94731 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ElementValue.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ElementValue.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ElementValuePair.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ElementValuePair.java similarity index 49% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ElementValuePair.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ElementValuePair.java index ce1b2895d58c92cc7e1c06aade0e682b7a7c60ce..6d5b87ea49c9dee8ced39832a502a4873d5ead18 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/ElementValuePair.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/ElementValuePair.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/EnumElementValue.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/EnumElementValue.java similarity index 42% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/EnumElementValue.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/EnumElementValue.java index bf5a13ec4fa26c09e14c6a4bc40e0d4164adebec..abd10dcf5dfa102a5208b83ad68e0b823baf9851 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/EnumElementValue.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/EnumElementValue.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; public class EnumElementValue extends ElementValue { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/JavaClass.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/JavaClass.java similarity index 77% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/JavaClass.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/JavaClass.java index 338bf1cae93381db2aa0f1a1e75bb856b58d55fc..8fad5dfb0a1813fa00352d516ec59e5ab715e2b3 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/JavaClass.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/JavaClass.java @@ -1,21 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; /** * Represents a Java class, i.e., the data structures, constant pool, diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/SimpleElementValue.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/SimpleElementValue.java similarity index 74% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/SimpleElementValue.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/SimpleElementValue.java index 73bbba60e1a152f431b0fe9212b24c93a22357cf..f9d05c8e177b0f55b98f975157a7ec7649f64742 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/SimpleElementValue.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/SimpleElementValue.java @@ -1,23 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; public class SimpleElementValue extends ElementValue { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Utility.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Utility.java similarity index 70% rename from servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Utility.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Utility.java index 0776d3afc9d59339dd0feed8312c74cc799c0ebc..ef40c0473bb895ffbc871cff9d0c2ea409c74e5f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/bcel/classfile/Utility.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/bcel/classfile/Utility.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.bcel.classfile; +package tech.smartboot.jakarta.third.bcel.classfile; -import org.smartboot.servlet.third.bcel.Const; +import tech.smartboot.jakarta.third.bcel.Const; import java.io.DataInput; import java.io.EOFException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DefaultFileItem.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DefaultFileItem.java similarity index 69% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DefaultFileItem.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DefaultFileItem.java index 3650fbf710b439739ffcf1fe13b88847d2cc240f..66edd4bbba192a0a1ed42e6975e480bc45820643 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DefaultFileItem.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DefaultFileItem.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; -import org.smartboot.servlet.third.commons.fileupload.disk.DiskFileItem; +import tech.smartboot.jakarta.third.commons.fileupload.disk.DiskFileItem; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DefaultFileItemFactory.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DefaultFileItemFactory.java similarity index 76% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DefaultFileItemFactory.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DefaultFileItemFactory.java index 1f1d362ca37725b00ebdd7e25496f7eb570586ab..5b1404a8f39b90693540f27043265fdb7900742a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DefaultFileItemFactory.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DefaultFileItemFactory.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; -import org.smartboot.servlet.third.commons.fileupload.disk.DiskFileItemFactory; +import tech.smartboot.jakarta.third.commons.fileupload.disk.DiskFileItemFactory; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DiskFileUpload.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DiskFileUpload.java similarity index 87% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DiskFileUpload.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DiskFileUpload.java index 0ae15fce33bd228734c16c002ef1562331b238a0..8ef1facd9c57aa9811e94b01975b4ed017805811 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/DiskFileUpload.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/DiskFileUpload.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.File; import java.util.List; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItem.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItem.java similarity index 87% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItem.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItem.java index 7e904de335c7637ec90f1087058c478b4237318e..044cf5e32724d6350fc2cfa4fe439c05c9fe4732 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItem.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItem.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; -import org.smartboot.servlet.third.commons.fileupload.servlet.ServletFileUpload; +import tech.smartboot.jakarta.third.commons.fileupload.servlet.ServletFileUpload; import java.io.File; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemFactory.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemFactory.java similarity index 54% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemFactory.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemFactory.java index 2a77170979f0e801df6eb17f25a5c95ea7f298b1..76a052382e8714acc3ee3faa6e499e37f1d9f404 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemFactory.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemFactory.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; /** *

A factory interface for creating {@link FileItem} instances. Factories diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemHeaders.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemHeaders.java similarity index 70% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemHeaders.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemHeaders.java index 1e0a36212d6b2a5ea11b79987b8ee407b9fa57b5..aee0cb99cdfd17e4e977b242fedb3b8e60728e2f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemHeaders.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemHeaders.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; import java.util.Iterator; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemHeadersSupport.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemHeadersSupport.java similarity index 50% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemHeadersSupport.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemHeadersSupport.java index 5f7e93c1638505fce333512210383558e9860c2f..1b599d0480cf02f1b1d2cd8bc9bc423800dc5923 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemHeadersSupport.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemHeadersSupport.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; /** * Interface that will indicate that {@link FileItem} or {@link FileItemStream} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemIterator.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemIterator.java similarity index 56% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemIterator.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemIterator.java index a3a4850dede9d886f505971bb35ab90a6ab5faeb..9ac786319b680f586435194b30dfacac9ebc0584 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemIterator.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemIterator.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemStream.java similarity index 78% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemStream.java index 4a7419f97ca57cbdddcba1319f369c42084fb192..40334b31bdc625ef57a3562d1dc648fd892b9832 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileItemStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileItemStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUpload.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUpload.java similarity index 72% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUpload.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUpload.java index 756060d6bb52cbfa8ebf99f31bf2a09d85245b80..d180fcc23eb073a6624c0cebabe3dae8abda12ac 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUpload.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUpload.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; /** *

High level API for processing file uploads.

diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUploadBase.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUploadBase.java similarity index 97% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUploadBase.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUploadBase.java index 86c607181ce28395a16f2b18d75b275d3df3574e..7e8b71efcc8d6b7f719af5b70a02bebdf33d3f5f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUploadBase.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUploadBase.java @@ -1,31 +1,24 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; - -import org.smartboot.servlet.third.commons.fileupload.MultipartStream.ItemInputStream; -import org.smartboot.servlet.third.commons.io.IOUtils; -import org.smartboot.servlet.third.commons.fileupload.servlet.ServletFileUpload; -import org.smartboot.servlet.third.commons.fileupload.servlet.ServletRequestContext; -import org.smartboot.servlet.third.commons.fileupload.util.Closeable; -import org.smartboot.servlet.third.commons.fileupload.util.FileItemHeadersImpl; -import org.smartboot.servlet.third.commons.fileupload.util.LimitedInputStream; -import org.smartboot.servlet.third.commons.fileupload.util.Streams; - -import javax.servlet.http.HttpServletRequest; +package tech.smartboot.jakarta.third.commons.fileupload; + +import tech.smartboot.jakarta.third.commons.fileupload.MultipartStream.ItemInputStream; +import tech.smartboot.jakarta.third.commons.io.IOUtils; +import tech.smartboot.jakarta.third.commons.fileupload.servlet.ServletFileUpload; +import tech.smartboot.jakarta.third.commons.fileupload.servlet.ServletRequestContext; +import tech.smartboot.jakarta.third.commons.fileupload.util.Closeable; +import tech.smartboot.jakarta.third.commons.fileupload.util.FileItemHeadersImpl; +import tech.smartboot.jakarta.third.commons.fileupload.util.LimitedInputStream; +import tech.smartboot.jakarta.third.commons.fileupload.util.Streams; + +import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUploadException.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUploadException.java similarity index 72% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUploadException.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUploadException.java index 551aa622c3492ec8a94d798451bae1e963f47581..5763da016e82878022aaa91c99b69365171bb88b 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/FileUploadException.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/FileUploadException.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; import java.io.PrintStream; import java.io.PrintWriter; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/InvalidFileNameException.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/InvalidFileNameException.java similarity index 60% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/InvalidFileNameException.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/InvalidFileNameException.java index d0c38c84b2f860ffef44fc26aa67f0fef7c67773..ad18a9eb63aefeae9122577057dd7e50a3f69477 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/InvalidFileNameException.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/InvalidFileNameException.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; /** * This exception is thrown in case of an invalid file name. diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/MultipartStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/MultipartStream.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/MultipartStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/MultipartStream.java index 91dd2a5cfb151b1813311f5092e50e645e31db76..7dfe00bf2514a5aefc9b5967f376afe4f88b4169 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/MultipartStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/MultipartStream.java @@ -1,24 +1,17 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; -import org.smartboot.servlet.third.commons.fileupload.FileUploadBase.FileUploadIOException; -import org.smartboot.servlet.third.commons.fileupload.util.Closeable; -import org.smartboot.servlet.third.commons.fileupload.util.Streams; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadBase.FileUploadIOException; +import tech.smartboot.jakarta.third.commons.fileupload.util.Closeable; +import tech.smartboot.jakarta.third.commons.fileupload.util.Streams; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/ParameterParser.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/ParameterParser.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/ParameterParser.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/ParameterParser.java index 1b46216a768c95b597149cd547f0ba69a06a4cdc..c59335db723bc7c22544d11d7b478c311b497ddb 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/ParameterParser.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/ParameterParser.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; -import org.smartboot.servlet.third.commons.fileupload.util.mime.MimeUtility; +import tech.smartboot.jakarta.third.commons.fileupload.util.mime.MimeUtility; import java.io.UnsupportedEncodingException; import java.util.HashMap; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/ProgressListener.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/ProgressListener.java similarity index 43% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/ProgressListener.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/ProgressListener.java index e81e381b43bd5c595c8427f79d592d8c7f9bf4e1..d434786b1fcb494a76134582da55c7c6cd15e22d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/ProgressListener.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/ProgressListener.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; /** * The {@link ProgressListener} may be used to display a progress bar diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/RequestContext.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/RequestContext.java similarity index 57% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/RequestContext.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/RequestContext.java index a45494d00701decb75c010c812bd8580700ffd07..8b42b28e3defba82a91dc25ac5af776fc0af20ce 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/RequestContext.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/RequestContext.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/UploadContext.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/UploadContext.java similarity index 41% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/UploadContext.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/UploadContext.java index 6a9f23b2de6e4a58f8066200ced09ed8ac083678..6ce404ec5cf4ab9c3d05147a2c08a617c4cce05a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/UploadContext.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/UploadContext.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload; +package tech.smartboot.jakarta.third.commons.fileupload; /** * Enhanced access to the request information needed for file uploads, diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/disk/DiskFileItem.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/disk/DiskFileItem.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/disk/DiskFileItem.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/disk/DiskFileItem.java index 4ccac35442975c0f9eea4dd8aab455ffb9866d9b..6595d669beaf480b32f15dcfd2278e1074243e81 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/disk/DiskFileItem.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/disk/DiskFileItem.java @@ -1,31 +1,24 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.disk; - -import org.smartboot.servlet.third.commons.io.FileUtils; -import org.smartboot.servlet.third.commons.io.IOUtils; -import org.smartboot.servlet.third.commons.io.output.DeferredFileOutputStream; -import org.smartboot.servlet.third.commons.fileupload.FileItem; -import org.smartboot.servlet.third.commons.fileupload.FileItemHeaders; -import org.smartboot.servlet.third.commons.fileupload.FileUploadException; -import org.smartboot.servlet.third.commons.fileupload.InvalidFileNameException; -import org.smartboot.servlet.third.commons.fileupload.ParameterParser; -import org.smartboot.servlet.third.commons.fileupload.servlet.ServletFileUpload; -import org.smartboot.servlet.third.commons.fileupload.util.Streams; +package tech.smartboot.jakarta.third.commons.fileupload.disk; + +import tech.smartboot.jakarta.third.commons.io.FileUtils; +import tech.smartboot.jakarta.third.commons.io.IOUtils; +import tech.smartboot.jakarta.third.commons.io.output.DeferredFileOutputStream; +import tech.smartboot.jakarta.third.commons.fileupload.FileItem; +import tech.smartboot.jakarta.third.commons.fileupload.FileItemHeaders; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadException; +import tech.smartboot.jakarta.third.commons.fileupload.InvalidFileNameException; +import tech.smartboot.jakarta.third.commons.fileupload.ParameterParser; +import tech.smartboot.jakarta.third.commons.fileupload.servlet.ServletFileUpload; +import tech.smartboot.jakarta.third.commons.fileupload.util.Streams; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/disk/DiskFileItemFactory.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/disk/DiskFileItemFactory.java similarity index 88% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/disk/DiskFileItemFactory.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/disk/DiskFileItemFactory.java index b16bf41de87b63705a8a3822c3f7782d71a0d9eb..bbaa8dfb88b3c3f1c5b0128d588cbfe284252963 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/disk/DiskFileItemFactory.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/disk/DiskFileItemFactory.java @@ -1,24 +1,17 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.disk; +package tech.smartboot.jakarta.third.commons.fileupload.disk; -import org.smartboot.servlet.third.commons.io.FileCleaningTracker; -import org.smartboot.servlet.third.commons.fileupload.FileItem; -import org.smartboot.servlet.third.commons.fileupload.FileItemFactory; +import tech.smartboot.jakarta.third.commons.io.FileCleaningTracker; +import tech.smartboot.jakarta.third.commons.fileupload.FileItem; +import tech.smartboot.jakarta.third.commons.fileupload.FileItemFactory; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/servlet/ServletFileUpload.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/servlet/ServletFileUpload.java similarity index 77% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/servlet/ServletFileUpload.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/servlet/ServletFileUpload.java index e5124f747b9f05718d6024a2d4477dca42094c20..83762ac30593d414e430e05ff4b4aa28bf0ca4e4 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/servlet/ServletFileUpload.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/servlet/ServletFileUpload.java @@ -1,29 +1,22 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.servlet; +package tech.smartboot.jakarta.third.commons.fileupload.servlet; -import org.smartboot.servlet.third.commons.fileupload.FileItem; -import org.smartboot.servlet.third.commons.fileupload.FileItemFactory; -import org.smartboot.servlet.third.commons.fileupload.FileItemIterator; -import org.smartboot.servlet.third.commons.fileupload.FileUpload; -import org.smartboot.servlet.third.commons.fileupload.FileUploadBase; -import org.smartboot.servlet.third.commons.fileupload.FileUploadException; +import tech.smartboot.jakarta.third.commons.fileupload.FileItem; +import tech.smartboot.jakarta.third.commons.fileupload.FileItemFactory; +import tech.smartboot.jakarta.third.commons.fileupload.FileItemIterator; +import tech.smartboot.jakarta.third.commons.fileupload.FileUpload; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadBase; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadException; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.List; import java.util.Map; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/servlet/ServletRequestContext.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/servlet/ServletRequestContext.java similarity index 72% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/servlet/ServletRequestContext.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/servlet/ServletRequestContext.java index d2603769e52cedc36c1f9b2ed3e5b96deb98002f..c49cf2ca8b8ecbe5d5b8eba83e1f7f90cc140832 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/servlet/ServletRequestContext.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/servlet/ServletRequestContext.java @@ -1,25 +1,18 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.servlet; +package tech.smartboot.jakarta.third.commons.fileupload.servlet; -import org.smartboot.servlet.third.commons.fileupload.FileUploadBase; -import org.smartboot.servlet.third.commons.fileupload.UploadContext; +import tech.smartboot.jakarta.third.commons.fileupload.FileUploadBase; +import tech.smartboot.jakarta.third.commons.fileupload.UploadContext; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/Closeable.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/Closeable.java new file mode 100644 index 0000000000000000000000000000000000000000..b3ad05cdac94cd6662d4e8106d950fa89339320d --- /dev/null +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/Closeable.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ +package tech.smartboot.jakarta.third.commons.fileupload.util; + +import java.io.IOException; + +/** + * Interface of an object, which may be closed. + */ +public interface Closeable { + + /** + * Closes the object. + * + * @throws IOException An I/O error occurred. + */ + void close() throws IOException; + + /** + * Returns, whether the object is already closed. + * + * @return True, if the object is closed, otherwise false. + * @throws IOException An I/O error occurred. + */ + boolean isClosed() throws IOException; + +} diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/FileItemHeadersImpl.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/FileItemHeadersImpl.java similarity index 71% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/FileItemHeadersImpl.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/FileItemHeadersImpl.java index 0a32bf2bf85248aadfd69684af4dc25b2e368a41..2d69956668534ad587d5fce66f46f1f7fcb9262c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/FileItemHeadersImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/FileItemHeadersImpl.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.util; +package tech.smartboot.jakarta.third.commons.fileupload.util; -import org.smartboot.servlet.third.commons.fileupload.FileItemHeaders; +import tech.smartboot.jakarta.third.commons.fileupload.FileItemHeaders; import java.io.Serializable; import java.util.ArrayList; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/LimitedInputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/LimitedInputStream.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/LimitedInputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/LimitedInputStream.java index c84ed03cedf6103b1657a5328278e5b79228e0e4..0ffecdc0f74635c26cdfb2d3f9c5b7b31eb0f5c6 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/LimitedInputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/LimitedInputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.util; +package tech.smartboot.jakarta.third.commons.fileupload.util; import java.io.FilterInputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/Streams.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/Streams.java similarity index 85% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/Streams.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/Streams.java index 3eb45ea8d19e648d929c3f63ff166f924ee2821b..c2320e809703a974386a8e2779fc375ab491ac5c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/Streams.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/Streams.java @@ -1,24 +1,17 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.util; +package tech.smartboot.jakarta.third.commons.fileupload.util; -import org.smartboot.servlet.third.commons.io.IOUtils; -import org.smartboot.servlet.third.commons.fileupload.FileItemStream; -import org.smartboot.servlet.third.commons.fileupload.InvalidFileNameException; +import tech.smartboot.jakarta.third.commons.io.IOUtils; +import tech.smartboot.jakarta.third.commons.fileupload.FileItemStream; +import tech.smartboot.jakarta.third.commons.fileupload.InvalidFileNameException; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/Base64Decoder.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/Base64Decoder.java similarity index 86% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/Base64Decoder.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/Base64Decoder.java index 5dc9e19b96a5d306079305924bcb0eaea4f282f7..d4159da89c6c9d2639ae69bad57f05618ed26f76 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/Base64Decoder.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/Base64Decoder.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.util.mime; +package tech.smartboot.jakarta.third.commons.fileupload.util.mime; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/MimeUtility.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/MimeUtility.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/MimeUtility.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/MimeUtility.java index d03c9395c170cc8b834f917fd6911e56ef0cc3df..b92680c45e4e47a3c942dc4c77dc4fee93e78a98 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/MimeUtility.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/MimeUtility.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.util.mime; +package tech.smartboot.jakarta.third.commons.fileupload.util.mime; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/enums/ServletMappingTypeEnum.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/ParseException.java similarity index 49% rename from servlet-core/src/main/java/org/smartboot/servlet/enums/ServletMappingTypeEnum.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/ParseException.java index 0bd38c91873a26997d138446dc89972aa531e359..af3a1e81da390fe06fecebbe7d0329b3e674d703 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/enums/ServletMappingTypeEnum.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/ParseException.java @@ -7,27 +7,25 @@ * and legally in accordance with the AGPL-3.0 open source agreement * without special permission from the smartboot organization. */ - -package org.smartboot.servlet.enums; +package tech.smartboot.jakarta.third.commons.fileupload.util.mime; /** - * 参考《Servlet3.1规范中文版》第12章 映射请求到Servlet - * - * @author 三刀 - * @version V1.0 , 2020/10/11 + * @since 1.3 */ -public enum ServletMappingTypeEnum { - /** - * 精准匹配 - */ - EXACT_MATCH, +final class ParseException extends Exception { + /** - * 路径匹配(前缀匹配) + * The UID to use when serializing this instance. */ - PREFIX_MATCH, + private static final long serialVersionUID = 5355281266579392077L; + /** - * 后缀匹配 + * Constructs a new exception with the specified detail message. + * + * @param message the detail message. */ - EXTENSION_MATCH, + public ParseException(String message) { + super(message); + } } diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/QuotedPrintableDecoder.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/QuotedPrintableDecoder.java similarity index 79% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/QuotedPrintableDecoder.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/QuotedPrintableDecoder.java index 9084d097fe459a0d02edf90b334eb7d0a4ede1ad..1535a8187d2f6e0dc1f5242fe9ae6ae33c6ad757 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/fileupload/util/mime/QuotedPrintableDecoder.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/fileupload/util/mime/QuotedPrintableDecoder.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.fileupload.util.mime; +package tech.smartboot.jakarta.third.commons.fileupload.util.mime; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/ByteOrderMark.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/ByteOrderMark.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/ByteOrderMark.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/ByteOrderMark.java index dfbcb96fa6a418576158daeb6e75764ea0d666b1..f5dc993092647ef4016a57ece55b4cf6cba51aaa 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/ByteOrderMark.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/ByteOrderMark.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; -import org.smartboot.servlet.third.commons.io.input.BOMInputStream; +import tech.smartboot.jakarta.third.commons.io.input.BOMInputStream; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/CopyUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/CopyUtils.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/CopyUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/CopyUtils.java index 82e7c642d352d11023fed368c93c7bc48295cb5f..8c7f423709e037a9d4ef48367f54872fadafe0d6 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/CopyUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/CopyUtils.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/EndianUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/EndianUtils.java similarity index 94% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/EndianUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/EndianUtils.java index 1854cba3e491e6260f59de87da7e57c7db506da1..66802eaa387f595b36cd0cccd6038db58be0797d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/EndianUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/EndianUtils.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; -import org.smartboot.servlet.third.commons.io.input.SwappedDataInputStream; +import tech.smartboot.jakarta.third.commons.io.input.SwappedDataInputStream; import java.io.EOFException; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileCleaner.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileCleaner.java similarity index 87% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileCleaner.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileCleaner.java index 12a3b575c0ed3d34e3f0f03248b20a4d3b3de853..814dcddf20d4365e275e04248416baa8d15198fd 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileCleaner.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileCleaner.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileCleaningTracker.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileCleaningTracker.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileCleaningTracker.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileCleaningTracker.java index d966313a5a63994c5b54b16ca8924632d016976d..42ab7e8aab36008a19c6764d860b52cca63d469f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileCleaningTracker.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileCleaningTracker.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.File; import java.lang.ref.PhantomReference; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileDeleteStrategy.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileDeleteStrategy.java similarity index 85% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileDeleteStrategy.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileDeleteStrategy.java index 6eccbbd17052d3986d6db277b3068c3559a97084..43a03eb821852e3850fe1268e788d06377d9f047 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileDeleteStrategy.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileDeleteStrategy.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.File; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileExistsException.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileExistsException.java similarity index 51% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileExistsException.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileExistsException.java index 4a28e51fe7307e4bda2cbc3e7657df603bbc611b..d7808bcc182c9b15af5b4b8eef9b616a17d1c093 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileExistsException.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileExistsException.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.File; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileSystemUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileSystemUtils.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileSystemUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileSystemUtils.java index 7a677ca2890ebbc82ef57bb8874ba1e9df8332a7..139ac5320c8b742ff60af0732d238e5b200d580f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileSystemUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileSystemUtils.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.BufferedReader; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileUtils.java similarity index 98% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileUtils.java index a100c673a316ebe25423db304a186e9998bfed85..7fa36a065ea8af45d955b8f0fa6d3e019efa230d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FileUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FileUtils.java @@ -1,29 +1,22 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; - -import org.smartboot.servlet.third.commons.io.filefilter.DirectoryFileFilter; -import org.smartboot.servlet.third.commons.io.filefilter.FalseFileFilter; -import org.smartboot.servlet.third.commons.io.filefilter.FileFilterUtils; -import org.smartboot.servlet.third.commons.io.filefilter.IOFileFilter; -import org.smartboot.servlet.third.commons.io.filefilter.NameFileFilter; -import org.smartboot.servlet.third.commons.io.filefilter.SuffixFileFilter; -import org.smartboot.servlet.third.commons.io.filefilter.TrueFileFilter; -import org.smartboot.servlet.third.commons.io.output.NullOutputStream; +package tech.smartboot.jakarta.third.commons.io; + +import tech.smartboot.jakarta.third.commons.io.filefilter.DirectoryFileFilter; +import tech.smartboot.jakarta.third.commons.io.filefilter.FalseFileFilter; +import tech.smartboot.jakarta.third.commons.io.filefilter.FileFilterUtils; +import tech.smartboot.jakarta.third.commons.io.filefilter.IOFileFilter; +import tech.smartboot.jakarta.third.commons.io.filefilter.NameFileFilter; +import tech.smartboot.jakarta.third.commons.io.filefilter.SuffixFileFilter; +import tech.smartboot.jakarta.third.commons.io.filefilter.TrueFileFilter; +import tech.smartboot.jakarta.third.commons.io.output.NullOutputStream; import java.io.File; import java.io.FileFilter; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FilenameUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FilenameUtils.java similarity index 98% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FilenameUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FilenameUtils.java index 32dfe3d075798c1c4f889341bf6d0754d3f5f054..249a1a6fabdfe1470b4bef3c66f5713a4f84d53e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/FilenameUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/FilenameUtils.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.File; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOCase.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOCase.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOCase.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOCase.java index af5a3450b714a541df4ba60bfd1c82ba9c9db952..d6bd222a8e0972dfe044370b1e9ae7abcc668e4d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOCase.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOCase.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOExceptionWithCause.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOExceptionWithCause.java similarity index 66% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOExceptionWithCause.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOExceptionWithCause.java index cb36a84f2cd66aa045921f2010c0d68905b468fa..3623de346186aefb8acfaefda54055fa2996925a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOExceptionWithCause.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOExceptionWithCause.java @@ -1,21 +1,14 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOUtils.java similarity index 98% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOUtils.java index b300387022675e75a9c00d87f19609f8a484dbcf..1f3f8c920f94c1cc7aebedb203429159e905d891 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/IOUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/IOUtils.java @@ -1,23 +1,16 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; -import org.smartboot.servlet.third.commons.io.output.ByteArrayOutputStream; -import org.smartboot.servlet.third.commons.io.output.StringBuilderWriter; +import tech.smartboot.jakarta.third.commons.io.output.ByteArrayOutputStream; +import tech.smartboot.jakarta.third.commons.io.output.StringBuilderWriter; import java.io.BufferedInputStream; import java.io.BufferedReader; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/LineIterator.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/LineIterator.java similarity index 85% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/LineIterator.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/LineIterator.java index 523e8b2766f1932f5793ef91399d22b9aa89bb8e..23e441647ab96b4a7b113ff234e23515c80761ed 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/LineIterator.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/LineIterator.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; import java.io.BufferedReader; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/ThreadMonitor.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/ThreadMonitor.java similarity index 77% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/ThreadMonitor.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/ThreadMonitor.java index 2e9841ba6902bcb958c8b9a5ea958067bf9a8941..7941b5d4ffa7ce60cb06e0bf0d30ee035125112c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/ThreadMonitor.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/ThreadMonitor.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io; +package tech.smartboot.jakarta.third.commons.io; /** * Monitors a thread, interrupting it of it reaches the specified timout. diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/AbstractFileComparator.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/AbstractFileComparator.java similarity index 63% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/AbstractFileComparator.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/AbstractFileComparator.java index 60b19925be095b5dd243c2913df799c901127f0b..3e1565ef49085e2940ef3baf28304228947a2b7f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/AbstractFileComparator.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/AbstractFileComparator.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.comparator; +package tech.smartboot.jakarta.third.commons.io.comparator; import java.io.File; import java.util.Arrays; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/NameFileComparator.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/NameFileComparator.java similarity index 80% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/NameFileComparator.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/NameFileComparator.java index 383f9d9b15bbcf7fa3eb3691cec7fbdfad2f466a..028d8e9cd33b4ebee534cb55f88ebf371621e4fe 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/NameFileComparator.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/NameFileComparator.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.comparator; +package tech.smartboot.jakarta.third.commons.io.comparator; -import org.smartboot.servlet.third.commons.io.IOCase; +import tech.smartboot.jakarta.third.commons.io.IOCase; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/ReverseComparator.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/ReverseComparator.java similarity index 64% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/ReverseComparator.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/ReverseComparator.java index 0de81780d26249078f0afdfa9b6f915f08a91fa8..834efd659007d9bc4326808537355b22132f69d0 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/comparator/ReverseComparator.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/comparator/ReverseComparator.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.comparator; +package tech.smartboot.jakarta.third.commons.io.comparator; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AbstractFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AbstractFileFilter.java similarity index 60% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AbstractFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AbstractFileFilter.java index 0d66f5544d17cb63a0bc7ef7bd49f4d40e0c259d..9a24a293c294ebb7600e5e0bf5d37472123984d1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AbstractFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AbstractFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AgeFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AgeFileFilter.java similarity index 83% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AgeFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AgeFileFilter.java index 909e13774a53ef955134079ed072000d68e16322..196d5ea04a39a0c5c3710fe6b13bd2d56d49d040 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AgeFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AgeFileFilter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.FileUtils; +import tech.smartboot.jakarta.third.commons.io.FileUtils; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AndFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AndFileFilter.java similarity index 83% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AndFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AndFileFilter.java index 4651479c84a2f42f6479de6dec41bc85849188d8..b4de93d6e3d796502f4348c34e9376723c80702a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/AndFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/AndFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/ConditionalFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/ConditionalFileFilter.java similarity index 58% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/ConditionalFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/ConditionalFileFilter.java index 64f9e3a05c1860a166ba04e72b58769cde63257f..23cbe4a9ecdac796bdb080bf68e32ce66b437b4f 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/ConditionalFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/ConditionalFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.util.List; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/DelegateFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/DelegateFileFilter.java similarity index 74% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/DelegateFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/DelegateFileFilter.java index 3c144df7a56467b1b86126bce1b548edd9203959..d49b0ee6245554b1fcfb02b8a86be6d01bb98b5e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/DelegateFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/DelegateFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.FileFilter; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/DirectoryFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/DirectoryFileFilter.java similarity index 63% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/DirectoryFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/DirectoryFileFilter.java index bc9d5ca79a233c603cfb8fa6ca7535a0453d9c7e..c2279611afd304027e0794d5a74f7e5b59d9d741 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/DirectoryFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/DirectoryFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FalseFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FalseFileFilter.java similarity index 59% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FalseFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FalseFileFilter.java index 233ee07800b5a25810c6f21c75e329dfc94b3430..983a3f5d5a25b41013b41e12459c604b46fda3b2 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FalseFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FalseFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FileFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FileFileFilter.java similarity index 56% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FileFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FileFileFilter.java index 82d4ec3a48186446ec47936f7fdca2a73820473c..834c1834a359e7c40593b280e6dacc456f2c7c0a 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FileFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FileFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FileFilterUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FileFilterUtils.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FileFilterUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FileFilterUtils.java index c3b92ffaae8aa4e5a8c93a5e0829da629f063650..3b5d2bd0ad8db664c38f4f49aa285a049aad0782 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/FileFilterUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/FileFilterUtils.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.IOCase; +import tech.smartboot.jakarta.third.commons.io.IOCase; import java.io.File; import java.io.FileFilter; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/IOFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/IOFileFilter.java similarity index 52% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/IOFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/IOFileFilter.java index ce12c061464d61074c0288afecca416c6da66b37..c7254c239eb6332aafb9fda6d28c6adf6bb1f71d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/IOFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/IOFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.FileFilter; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/MagicNumberFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/MagicNumberFileFilter.java similarity index 90% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/MagicNumberFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/MagicNumberFileFilter.java index 37a05c3035950bde52466263a1b7a57b80a5e72c..4306d8741da40108be6ee63b66310b01db67c64d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/MagicNumberFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/MagicNumberFileFilter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.IOUtils; +import tech.smartboot.jakarta.third.commons.io.IOUtils; import java.io.File; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/NameFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/NameFileFilter.java similarity index 86% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/NameFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/NameFileFilter.java index 3094ed942b31133989b9f005e45bdee0e4ccfd0d..b7fdab62ca825224bac0c878dbb37460ee4b4741 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/NameFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/NameFileFilter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.IOCase; +import tech.smartboot.jakarta.third.commons.io.IOCase; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/NotFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/NotFileFilter.java similarity index 67% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/NotFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/NotFileFilter.java index 123edfbebca86337151a6462ce54324b998e428c..900f5ade6887b85da608eb8532a00b514c49e8d2 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/NotFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/NotFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/OrFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/OrFileFilter.java similarity index 82% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/OrFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/OrFileFilter.java index b6723ba57513959805fd62aecf212dbd6fd643d6..63f4668e5b6972273b8a0095d3a5c85eb827a7b6 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/OrFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/OrFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/PrefixFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/PrefixFileFilter.java similarity index 87% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/PrefixFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/PrefixFileFilter.java index a1289b2102b7db8a64f8719a42a11a075234cf21..ea2ba7ec498f8fd4b2edba69be27e580e8a43afc 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/PrefixFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/PrefixFileFilter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.IOCase; +import tech.smartboot.jakarta.third.commons.io.IOCase; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/SizeFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/SizeFileFilter.java similarity index 76% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/SizeFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/SizeFileFilter.java index 5605aa4faff6f02a80e5b2e7c9548426e74f1c52..68daf25af5e5048ee69f6ff8f913ac236238ce7c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/SizeFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/SizeFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/SuffixFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/SuffixFileFilter.java similarity index 87% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/SuffixFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/SuffixFileFilter.java index 16927625b6a8d5a7632cc051aa24d42786512705..dd7024815616aac81508195a1ccc17f71370a595 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/SuffixFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/SuffixFileFilter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.IOCase; +import tech.smartboot.jakarta.third.commons.io.IOCase; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/TrueFileFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/TrueFileFilter.java similarity index 59% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/TrueFileFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/TrueFileFilter.java index 2c3b52a5a818e85d21fe5e212e7f0e8d160cf0a3..5d79a04796e586c131f164641e2a4f43255efbaa 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/TrueFileFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/TrueFileFilter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/WildcardFilter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/WildcardFilter.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/WildcardFilter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/WildcardFilter.java index 4dacea1ae3a692a58d8de360a1602f353a8e5181..e01de636531867d780c796fdc013dcff807621fd 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/filefilter/WildcardFilter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/filefilter/WildcardFilter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.filefilter; +package tech.smartboot.jakarta.third.commons.io.filefilter; -import org.smartboot.servlet.third.commons.io.FilenameUtils; +import tech.smartboot.jakarta.third.commons.io.FilenameUtils; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/BOMInputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/BOMInputStream.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/BOMInputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/BOMInputStream.java index 60fc8609c0dcfa46c4206353cb64ada65b91c36b..a37a9913c26352103f591efbf4fff4567a9f3c91 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/BOMInputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/BOMInputStream.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; -import org.smartboot.servlet.third.commons.io.ByteOrderMark; +import tech.smartboot.jakarta.third.commons.io.ByteOrderMark; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ClosedInputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ClosedInputStream.java similarity index 48% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ClosedInputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ClosedInputStream.java index 037a2e62cc0c1516f2426d81224cab4676adfadd..f48d52585e5d2e3f78311010a485ef543287b135 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ClosedInputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ClosedInputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ProxyInputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ProxyInputStream.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ProxyInputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ProxyInputStream.java index d644c8f8b720d220ad82f768dda8637efbb681c6..04da0f9fa96dfaa075161caf518b3a3d73ae7625 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ProxyInputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ProxyInputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; import java.io.FilterInputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ReaderInputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ReaderInputStream.java similarity index 91% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ReaderInputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ReaderInputStream.java index c815f94f69bffea5e2c61849533b7f79f0766433..97192156b393fb570874b35b867ee562180058a3 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/ReaderInputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/ReaderInputStream.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; -import org.smartboot.servlet.third.commons.io.output.WriterOutputStream; +import tech.smartboot.jakarta.third.commons.io.output.WriterOutputStream; import java.io.IOException; import java.io.InputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/SwappedDataInputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/SwappedDataInputStream.java similarity index 88% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/SwappedDataInputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/SwappedDataInputStream.java index 358214adda6989be82801667e02565f5e365728a..560195e80c13f354d2389c9116b352c9529f1252 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/SwappedDataInputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/SwappedDataInputStream.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; -import org.smartboot.servlet.third.commons.io.EndianUtils; +import tech.smartboot.jakarta.third.commons.io.EndianUtils; import java.io.DataInput; import java.io.EOFException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/Tailer.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/Tailer.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/Tailer.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/Tailer.java index 8ddbc4e3d2a71d7666f93eae67e59b50a4984d15..d34624dc9e32c4bacac6f942c9e56972cfd15f43 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/Tailer.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/Tailer.java @@ -1,23 +1,16 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; -import org.smartboot.servlet.third.commons.io.FileUtils; -import org.smartboot.servlet.third.commons.io.IOUtils; +import tech.smartboot.jakarta.third.commons.io.FileUtils; +import tech.smartboot.jakarta.third.commons.io.IOUtils; import java.io.File; import java.io.FileNotFoundException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/TailerListener.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/TailerListener.java similarity index 59% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/TailerListener.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/TailerListener.java index 4de9406e674f6f1a29e419bb1a1832bb265c2459..63e79418b16db5a3ad75fc67db6e45051477203e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/TailerListener.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/TailerListener.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; /** * Listener for events from a {@link Tailer}. diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/TailerListenerAdapter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/TailerListenerAdapter.java similarity index 55% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/TailerListenerAdapter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/TailerListenerAdapter.java index ed40769d82e1b1b442fcad6a4df6e966999169dd..1a493e6ab79f9e7a30a337cb480b55c58b506dc1 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/TailerListenerAdapter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/TailerListenerAdapter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; /** * {@link TailerListener} Adapter. diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/XmlStreamReader.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/XmlStreamReader.java similarity index 96% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/XmlStreamReader.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/XmlStreamReader.java index 7cd89e79e597b383db48f792a11c9aac80356f27..6e6d629e58bc509daa6d9d00f1ec3ad151f38c5d 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/XmlStreamReader.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/XmlStreamReader.java @@ -1,23 +1,16 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; -import org.smartboot.servlet.third.commons.io.ByteOrderMark; -import org.smartboot.servlet.third.commons.io.output.XmlStreamWriter; +import tech.smartboot.jakarta.third.commons.io.ByteOrderMark; +import tech.smartboot.jakarta.third.commons.io.output.XmlStreamWriter; import java.io.BufferedInputStream; import java.io.BufferedReader; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/XmlStreamReaderException.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/XmlStreamReaderException.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/XmlStreamReaderException.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/XmlStreamReaderException.java index af118a71c40740e02c40f65f56a6285b59867010..e907bc7d1e785fc8d06c88f791ec0a63fd83988c 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/input/XmlStreamReaderException.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/input/XmlStreamReaderException.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.input; +package tech.smartboot.jakarta.third.commons.io.input; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationListener.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationListener.java similarity index 65% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationListener.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationListener.java index 4a61a70a12260750ca67173966bf5112124f0ac4..069a6a785fb829d8a1e1cac18abb11e25f3ee80e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationListener.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationListener.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.monitor; +package tech.smartboot.jakarta.third.commons.io.monitor; import java.io.File; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationMonitor.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationMonitor.java similarity index 85% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationMonitor.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationMonitor.java index bc6ce1be122b1b585d0a394485ebefff36cd8965..c597f03eb9e234d0bc6b1a85693961e5de1a6978 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationMonitor.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationMonitor.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.monitor; +package tech.smartboot.jakarta.third.commons.io.monitor; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationObserver.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationObserver.java similarity index 93% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationObserver.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationObserver.java index 45fd9197da7910929b5e73203d95f7a0c856ad2f..1b78582b975a011d069e28b67584fe528ba25d59 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileAlterationObserver.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileAlterationObserver.java @@ -1,24 +1,17 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.monitor; +package tech.smartboot.jakarta.third.commons.io.monitor; -import org.smartboot.servlet.third.commons.io.FileUtils; -import org.smartboot.servlet.third.commons.io.IOCase; -import org.smartboot.servlet.third.commons.io.comparator.NameFileComparator; +import tech.smartboot.jakarta.third.commons.io.FileUtils; +import tech.smartboot.jakarta.third.commons.io.IOCase; +import tech.smartboot.jakarta.third.commons.io.comparator.NameFileComparator; import java.io.File; import java.io.FileFilter; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileEntry.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileEntry.java similarity index 88% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileEntry.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileEntry.java index e4df2c4d11e781a6c6234ce194bbe8d296b87cde..96e9c6d40426b2adfbedd2f0c3fc31f6cd41edaa 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/monitor/FileEntry.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/monitor/FileEntry.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.monitor; +package tech.smartboot.jakarta.third.commons.io.monitor; import java.io.File; import java.io.Serializable; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ByteArrayOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ByteArrayOutputStream.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ByteArrayOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ByteArrayOutputStream.java index 00243bdb8f3545b7c1b1888ee80debe3cb9ff8b7..b4977bd384ff337615f794bacea1ce069aa809da 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ByteArrayOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ByteArrayOutputStream.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; -import org.smartboot.servlet.third.commons.io.input.ClosedInputStream; +import tech.smartboot.jakarta.third.commons.io.input.ClosedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/DeferredFileOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/DeferredFileOutputStream.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/DeferredFileOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/DeferredFileOutputStream.java index 27f6188e62c31aeab8e745d70152569c4c2191e8..68d271d398e0d545f6c4d17cc5611083b06785c9 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/DeferredFileOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/DeferredFileOutputStream.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; -import org.smartboot.servlet.third.commons.io.IOUtils; +import tech.smartboot.jakarta.third.commons.io.IOUtils; import java.io.File; import java.io.FileInputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/NullOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/NullOutputStream.java similarity index 59% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/NullOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/NullOutputStream.java index 0fa2d6dff15892108eab75f59957d5b9581648c3..58dec9e4c8dd53a459fd8a6a8d6b5a95b6f89fae 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/NullOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/NullOutputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ProxyOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ProxyOutputStream.java similarity index 84% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ProxyOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ProxyOutputStream.java index 040a09537f56a855067bae7655b4393e17f4cb8c..19d8d448a837ff4f789e4a6b696bd7166a6c230e 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ProxyOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ProxyOutputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; import java.io.FilterOutputStream; import java.io.IOException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/StringBuilderWriter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/StringBuilderWriter.java similarity index 81% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/StringBuilderWriter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/StringBuilderWriter.java index 83dcf4bfe30b3d9173aaea31bcd83c6a6d35ada3..b7906b41fd97c7c145403801258435015889c087 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/StringBuilderWriter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/StringBuilderWriter.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; import java.io.Serializable; import java.io.Writer; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/TeeOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/TeeOutputStream.java similarity index 74% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/TeeOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/TeeOutputStream.java index c7cf7fccec115df67d333101807cc2418e2f977c..c0604b0498da3197db2687f6af42f0b72177219b 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/TeeOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/TeeOutputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ThresholdingOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ThresholdingOutputStream.java similarity index 88% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ThresholdingOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ThresholdingOutputStream.java index 0df63b0b17a009acb06e1ad5c329e4f85c7c4a1b..3c1de5c35d7fdd8e553a61ff4af9d82bf4250383 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/ThresholdingOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/ThresholdingOutputStream.java @@ -1,20 +1,13 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/WriterOutputStream.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/WriterOutputStream.java similarity index 92% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/WriterOutputStream.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/WriterOutputStream.java index ad7a432d2c2211a91655012217e04cac2a77b551..e7a71330595a00f702ec55e893188ed3618d5caa 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/WriterOutputStream.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/WriterOutputStream.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; -import org.smartboot.servlet.third.commons.io.input.ReaderInputStream; +import tech.smartboot.jakarta.third.commons.io.input.ReaderInputStream; import java.io.IOException; import java.io.OutputStream; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/XmlStreamWriter.java b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/XmlStreamWriter.java similarity index 87% rename from servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/XmlStreamWriter.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/XmlStreamWriter.java index f9f2d6b5a61c5e1511cc53f647f29c5a23df08c2..5fc0e63e55bb19cbae8c0334a1eca876537d1685 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/third/commons/io/output/XmlStreamWriter.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/third/commons/io/output/XmlStreamWriter.java @@ -1,22 +1,15 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] * - * http://www.apache.org/licenses/LICENSE-2.0 + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. */ -package org.smartboot.servlet.third.commons.io.output; +package tech.smartboot.jakarta.third.commons.io.output; -import org.smartboot.servlet.third.commons.io.input.XmlStreamReader; +import tech.smartboot.jakarta.third.commons.io.input.XmlStreamReader; import java.io.File; import java.io.FileNotFoundException; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/util/CollectionUtils.java b/servlet-core/src/main/java/tech/smartboot/jakarta/util/CollectionUtils.java similarity index 95% rename from servlet-core/src/main/java/org/smartboot/servlet/util/CollectionUtils.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/util/CollectionUtils.java index 5f5de8f5a02ebe0f8d53785b014f7ccdc4373d07..4a761fd5fbd0f81105c5b9f908499c4b8b935ce0 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/util/CollectionUtils.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/util/CollectionUtils.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.util; +package tech.smartboot.jakarta.util; import java.util.Collection; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/util/DateUtil.java b/servlet-core/src/main/java/tech/smartboot/jakarta/util/DateUtil.java similarity index 97% rename from servlet-core/src/main/java/org/smartboot/servlet/util/DateUtil.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/util/DateUtil.java index 8254824f4ddfaf41d74f789837cec03ca6ee0929..57a56a75a05aed8b2fa989565096c04ca8e75fe7 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/util/DateUtil.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/util/DateUtil.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.util; +package tech.smartboot.jakarta.util; import java.text.ParseException; import java.text.SimpleDateFormat; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/util/LRUCache.java b/servlet-core/src/main/java/tech/smartboot/jakarta/util/LRUCache.java similarity index 98% rename from servlet-core/src/main/java/org/smartboot/servlet/util/LRUCache.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/util/LRUCache.java index a36f1a856584a9316b90eb0b7593a7438bc9cb31..d929d721b56bd05f0ae4335df359b6995898cf35 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/util/LRUCache.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/util/LRUCache.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.util; +package tech.smartboot.jakarta.util; import java.util.LinkedHashMap; import java.util.concurrent.locks.Lock; diff --git a/servlet-core/src/main/java/org/smartboot/servlet/util/PathMatcherUtil.java b/servlet-core/src/main/java/tech/smartboot/jakarta/util/PathMatcherUtil.java similarity index 89% rename from servlet-core/src/main/java/org/smartboot/servlet/util/PathMatcherUtil.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/util/PathMatcherUtil.java index 86e3d771c3c27df83c7a7345c476bfcfb9cefa5d..70ba162029d99bd96ebcb39c39fddc040ae5d3bc 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/util/PathMatcherUtil.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/util/PathMatcherUtil.java @@ -8,10 +8,10 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.util; +package tech.smartboot.jakarta.util; -import org.smartboot.servlet.conf.ServletMappingInfo; -import org.smartboot.servlet.enums.ServletMappingTypeEnum; +import jakarta.servlet.http.MappingMatch; +import tech.smartboot.jakarta.conf.ServletMappingInfo; import java.net.URI; import java.net.URISyntaxException; @@ -39,11 +39,11 @@ public class PathMatcherUtil { if (!mapping.startsWith("/")) { throw new IllegalArgumentException("invalid mapping: " + mapping); } - return new ServletMappingInfo(mapping, ServletMappingTypeEnum.EXACT_MATCH); + return new ServletMappingInfo(mapping, MappingMatch.EXACT); } else if (mapping.startsWith("*.")) { - return new ServletMappingInfo(mapping, ServletMappingTypeEnum.EXTENSION_MATCH); + return new ServletMappingInfo(mapping, MappingMatch.EXTENSION); } else if (mapping.startsWith("/") && mapping.endsWith("/*")) { - return new ServletMappingInfo(mapping, ServletMappingTypeEnum.PREFIX_MATCH); + return new ServletMappingInfo(mapping, MappingMatch.PATH); } else { throw new IllegalArgumentException("illegal mapping : " + mapping); } @@ -57,11 +57,11 @@ public class PathMatcherUtil { */ public static int matches(String uri, int startIndex, ServletMappingInfo mappingInfo) { String pattern = mappingInfo.getMapping(); - ServletMappingTypeEnum mappingTypeEnum = mappingInfo.getMappingType(); + MappingMatch mappingTypeEnum = mappingInfo.getMappingType(); int servletPathEndIndex = -1; switch (mappingTypeEnum) { //精准匹配 - case EXACT_MATCH: + case EXACT: //《Servlet3.1规范中文版》12.2 映射规范 //空字符串“”是一个特殊的 URL 模式,其精确映射到应用的上下文根, // 即,http://host:port// 请求形式。 @@ -81,7 +81,7 @@ public class PathMatcherUtil { servletPathEndIndex = startIndex + pattern.length(); break; //路径匹配(前缀匹配) - case PREFIX_MATCH: + case PATH: //《Servlet3.1规范中文版》12.2 映射规范 //空字符串“”是一个特殊的 URL 模式,其精确映射到应用的上下文根, // 即,http://host:port// 请求形式。 @@ -110,7 +110,7 @@ public class PathMatcherUtil { servletPathEndIndex = startIndex + pattern.length() - 2; break; //后缀匹配 - case EXTENSION_MATCH: + case EXTENSION: // 不比较"*.xx" 中的 * int uriStartIndex = uri.length() - pattern.length(); if (uriStartIndex <= 0) { diff --git a/servlet-core/src/main/java/org/smartboot/servlet/util/WarUtil.java b/servlet-core/src/main/java/tech/smartboot/jakarta/util/WarUtil.java similarity index 98% rename from servlet-core/src/main/java/org/smartboot/servlet/util/WarUtil.java rename to servlet-core/src/main/java/tech/smartboot/jakarta/util/WarUtil.java index de1455f183053a97681944ab68fe1dfad4da0c64..2b496a4b3b44228fab27ab39996b3b0ffedd1227 100644 --- a/servlet-core/src/main/java/org/smartboot/servlet/util/WarUtil.java +++ b/servlet-core/src/main/java/tech/smartboot/jakarta/util/WarUtil.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.servlet.util; +package tech.smartboot.jakarta.util; import java.io.File; import java.io.FileOutputStream; diff --git a/servlet-core/src/main/resources/META-INF/services/org.smartboot.servlet.plugins.Plugin b/servlet-core/src/main/resources/META-INF/services/tech.smartboot.jakarta.plugins.Plugin similarity index 57% rename from servlet-core/src/main/resources/META-INF/services/org.smartboot.servlet.plugins.Plugin rename to servlet-core/src/main/resources/META-INF/services/tech.smartboot.jakarta.plugins.Plugin index b0c011ea79a4a48e2bd7aff7c65910b845f076d4..b9f8f8dad491fe0c920b848811fe59a7229bb2a4 100644 --- a/servlet-core/src/main/resources/META-INF/services/org.smartboot.servlet.plugins.Plugin +++ b/servlet-core/src/main/resources/META-INF/services/tech.smartboot.jakarta.plugins.Plugin @@ -8,8 +8,8 @@ # without special permission from the smartboot organization. # -org.smartboot.servlet.plugins.session.SessionPlugin -org.smartboot.servlet.plugins.dispatcher.DispatcherPlugin -org.smartboot.servlet.plugins.contact.ContactPlugin -org.smartboot.servlet.plugins.websocket.WebsocketPlugin -org.smartboot.servlet.plugins.async.AsyncContextPlugin \ No newline at end of file +tech.smartboot.jakarta.plugins.session.SessionPlugin +tech.smartboot.jakarta.plugins.dispatcher.DispatcherPlugin +tech.smartboot.jakarta.plugins.contact.ContactPlugin +tech.smartboot.jakarta.plugins.websocket.WebsocketPlugin +tech.smartboot.jakarta.plugins.async.AsyncContextPlugin \ No newline at end of file diff --git a/smart-servlet-maven-plugin/pom.xml b/smart-servlet-maven-plugin/pom.xml index a034696c0675e40a0bafd68b5807f7d25e329782..217eb38a841477aac2e33a8413960f76e7c31685 100644 --- a/smart-servlet-maven-plugin/pom.xml +++ b/smart-servlet-maven-plugin/pom.xml @@ -14,7 +14,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> smart-servlet-parent - org.smartboot.servlet + tech.smartboot.jakarta 1.5 4.0.0 @@ -36,7 +36,7 @@ provided - org.smartboot.servlet + tech.smartboot.jakarta servlet-core diff --git a/smart-servlet-maven-plugin/src/main/java/org/smartboot/maven/plugin/servlet/RunMojo.java b/smart-servlet-maven-plugin/src/main/java/tech/smartboot/maven/plugin/jakarta/RunMojo.java similarity index 96% rename from smart-servlet-maven-plugin/src/main/java/org/smartboot/maven/plugin/servlet/RunMojo.java rename to smart-servlet-maven-plugin/src/main/java/tech/smartboot/maven/plugin/jakarta/RunMojo.java index 5666c8b7c83b10ca1cd56ca8d4646f7b41674a90..9ccde6e5e079c49e0cf7f7495da2b44809f32eba 100644 --- a/smart-servlet-maven-plugin/src/main/java/org/smartboot/maven/plugin/servlet/RunMojo.java +++ b/smart-servlet-maven-plugin/src/main/java/tech/smartboot/maven/plugin/jakarta/RunMojo.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.maven.plugin.servlet; +package tech.smartboot.maven.plugin.jakarta; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; @@ -78,7 +78,7 @@ public class RunMojo extends AbstractMojo { urlList.toArray(urls); URLClassLoader classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader()); File webFile = new File(configurationDir, artifactId + "-" + version); - Class clazz = classLoader.loadClass("org.smartboot.maven.plugin.servlet.Starter"); + Class clazz = classLoader.loadClass("tech.smartboot.maven.plugin.jakarta.Starter"); clazz.getConstructor(String.class, String.class, int.class, ClassLoader.class).newInstance(webFile.getAbsolutePath(), path, port, classLoader); } catch (Exception e) { e.printStackTrace(); diff --git a/smart-servlet-maven-plugin/src/main/java/org/smartboot/maven/plugin/servlet/Starter.java b/smart-servlet-maven-plugin/src/main/java/tech/smartboot/maven/plugin/jakarta/Starter.java similarity index 95% rename from smart-servlet-maven-plugin/src/main/java/org/smartboot/maven/plugin/servlet/Starter.java rename to smart-servlet-maven-plugin/src/main/java/tech/smartboot/maven/plugin/jakarta/Starter.java index bdc782cf9ea841265e6030c3bc112404606e6ba0..e7aa81ad762a50b7d8c0a5998d17b5e836d866a5 100644 --- a/smart-servlet-maven-plugin/src/main/java/org/smartboot/maven/plugin/servlet/Starter.java +++ b/smart-servlet-maven-plugin/src/main/java/tech/smartboot/maven/plugin/jakarta/Starter.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.maven.plugin.servlet; +package tech.smartboot.maven.plugin.jakarta; import org.smartboot.http.common.codec.websocket.CloseReason; import org.smartboot.http.server.HttpBootstrap; @@ -20,8 +20,8 @@ import org.smartboot.http.server.WebSocketRequest; import org.smartboot.http.server.WebSocketResponse; import org.smartboot.http.server.impl.WebSocketRequestImpl; import org.smartboot.http.server.impl.WebSocketResponseImpl; -import org.smartboot.servlet.Container; -import org.smartboot.servlet.provider.WebsocketProvider; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.provider.WebsocketProvider; import java.util.concurrent.CompletableFuture; diff --git a/spring-boot-starter/pom.xml b/spring-boot-starter/pom.xml index a6f5d73bec3f0e18e271e2c56907a2910936c578..c8b7a1fc8a41f07a9819c38c1f31a6404879ba0e 100644 --- a/spring-boot-starter/pom.xml +++ b/spring-boot-starter/pom.xml @@ -14,18 +14,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> smart-servlet-parent - org.smartboot.servlet + tech.smartboot.jakarta 1.5 - 2.7.18 + 3.3.1 4.0.0 smart-servlet-spring-boot-starter - org.smartboot.servlet + tech.smartboot.jakarta servlet-core diff --git a/spring-boot-starter/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java b/spring-boot-starter/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java deleted file mode 100644 index d611ccbe80fa474db3956b23d0d73309f66aa059..0000000000000000000000000000000000000000 --- a/spring-boot-starter/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] - * - * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 - * - * Enterprise users are required to use this project reasonably - * and legally in accordance with the AGPL-3.0 open source agreement - * without special permission from the smartboot organization. - */ - -package org.springframework.web.socket.server.standard; - -import org.smartboot.servlet.WebSocketServerContainer; -import org.smartboot.servlet.impl.HttpServletRequestImpl; -import org.springframework.http.server.ServerHttpRequest; -import org.springframework.http.server.ServerHttpResponse; -import org.springframework.web.socket.server.HandshakeFailureException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.websocket.Endpoint; -import javax.websocket.Extension; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public class TomcatRequestUpgradeStrategy extends AbstractStandardUpgradeStrategy { - - @Override - protected void upgradeInternal(ServerHttpRequest request, ServerHttpResponse response, String selectedProtocol, List selectedExtensions, Endpoint endpoint) throws HandshakeFailureException { - HttpServletRequestImpl servletRequest = (HttpServletRequestImpl)getHttpServletRequest(request); - HttpServletResponse servletResponse = getHttpServletResponse(response); - - StringBuffer requestUrl = servletRequest.getRequestURL(); - String path = servletRequest.getRequestURI(); // shouldn't matter - Map pathParams = Collections.emptyMap(); - - ServerEndpointRegistration endpointConfig = new ServerEndpointRegistration(path, endpoint); - endpointConfig.setSubprotocols(Collections.singletonList(selectedProtocol)); - endpointConfig.setExtensions(selectedExtensions); - - try { - getContainer(servletRequest).doUpgrade(servletRequest, servletResponse, endpointConfig, endpoint, pathParams); - } catch (ServletException ex) { - throw new HandshakeFailureException( - "Servlet request failed to upgrade to WebSocket: " + requestUrl, ex); - } catch (IOException ex) { - throw new HandshakeFailureException( - "Response update failed during upgrade to WebSocket: " + requestUrl, ex); - } - } - - @Override - public String[] getSupportedVersions() { - return new String[]{"13"}; - } - - @Override - protected WebSocketServerContainer getContainer(HttpServletRequest request) { - return (WebSocketServerContainer) super.getContainer(request); - } -} diff --git a/spring-boot-starter/src/main/java/org/smartboot/springboot/starter/ConfigurableSmartWebServerFactory.java b/spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/ConfigurableSmartWebServerFactory.java similarity index 92% rename from spring-boot-starter/src/main/java/org/smartboot/springboot/starter/ConfigurableSmartWebServerFactory.java rename to spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/ConfigurableSmartWebServerFactory.java index 67770b55b571c786d26d93dbbe39291249b3e936..5585747e5dd727ecd5705fceece2ea90d9ada2fc 100644 --- a/spring-boot-starter/src/main/java/org/smartboot/springboot/starter/ConfigurableSmartWebServerFactory.java +++ b/spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/ConfigurableSmartWebServerFactory.java @@ -8,17 +8,17 @@ * without special permission from the smartboot organization. */ -package org.smartboot.springboot.starter; +package tech.smartboot.springboot.starter; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.conf.DeploymentInfo; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.conf.DeploymentInfo; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; -import javax.websocket.server.ServerContainer; +import jakarta.websocket.server.ServerContainer; import java.io.File; /** diff --git a/spring-boot-starter/src/main/java/org/smartboot/springboot/starter/SmartContainerInitializer.java b/spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/SmartContainerInitializer.java similarity index 86% rename from spring-boot-starter/src/main/java/org/smartboot/springboot/starter/SmartContainerInitializer.java rename to spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/SmartContainerInitializer.java index 14934cb77f237d2421447caaf5adefe59b0b6b08..c7bdb19d0a9764cee8b412aeb7e24caf8cb985d2 100644 --- a/spring-boot-starter/src/main/java/org/smartboot/springboot/starter/SmartContainerInitializer.java +++ b/spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/SmartContainerInitializer.java @@ -8,13 +8,13 @@ * without special permission from the smartboot organization. */ -package org.smartboot.springboot.starter; +package tech.smartboot.springboot.starter; import org.springframework.boot.web.servlet.ServletContextInitializer; -import javax.servlet.ServletContainerInitializer; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; +import jakarta.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import java.util.Set; /** diff --git a/spring-boot-starter/src/main/java/org/smartboot/springboot/starter/SmartServletServer.java b/spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/SmartServletServer.java similarity index 95% rename from spring-boot-starter/src/main/java/org/smartboot/springboot/starter/SmartServletServer.java rename to spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/SmartServletServer.java index 1641f850b0d69b5014bed08a20bc2df0b9ca02d2..a69354ef65caf8faa0ee35aac53b780b1683b257 100644 --- a/spring-boot-starter/src/main/java/org/smartboot/springboot/starter/SmartServletServer.java +++ b/spring-boot-starter/src/main/java/tech/smartboot/springboot/starter/SmartServletServer.java @@ -8,7 +8,7 @@ * without special permission from the smartboot organization. */ -package org.smartboot.springboot.starter; +package tech.smartboot.springboot.starter; import org.smartboot.http.common.codec.websocket.CloseReason; import org.smartboot.http.server.HttpBootstrap; @@ -20,9 +20,9 @@ import org.smartboot.http.server.WebSocketRequest; import org.smartboot.http.server.WebSocketResponse; import org.smartboot.http.server.impl.WebSocketRequestImpl; import org.smartboot.http.server.impl.WebSocketResponseImpl; -import org.smartboot.servlet.Container; -import org.smartboot.servlet.ServletContextRuntime; -import org.smartboot.servlet.provider.WebsocketProvider; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.provider.WebsocketProvider; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerException; diff --git a/spring-boot-starter/src/main/resources/META-INF/spring.factories b/spring-boot-starter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 8cdf2a10777f5220445adfbe021369c5271c5bfa..0000000000000000000000000000000000000000 --- a/spring-boot-starter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.smartboot.springboot.starter.ConfigurableSmartWebServerFactory \ No newline at end of file diff --git a/spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000000000000000000000000000000000..3757c59763d2d918090828990601b03a3d2e8228 --- /dev/null +++ b/spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +tech.smartboot.springboot.starter.ConfigurableSmartWebServerFactory \ No newline at end of file diff --git a/springboot-demo/pom.xml b/springboot-demo/pom.xml index 36c081e9eeeec455c55a8b446a48fd9ba08a50af..1c9ee58c79e68ead70ac4c42395632056c5b0d8d 100644 --- a/springboot-demo/pom.xml +++ b/springboot-demo/pom.xml @@ -14,35 +14,41 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.smartboot.mqtt + tech.smartboot.jakarta springboot-demo 1.0-SNAPSHOT - 8 - 8 + 21 + 21 UTF-8 - - org.springframework.boot - spring-boot-starter-parent - 2.7.18 - + - - - org.springframework.boot - spring-boot-starter-security - + + org.springframework.boot + spring-boot-starter-parent + 3.3.1 + pom + import + + + + org.springframework.boot + spring-boot-starter-security + 3.3.1 + org.springframework.boot spring-boot-starter-websocket + 3.3.1 true org.springframework.boot spring-boot-starter-web + 3.3.1 @@ -51,26 +57,25 @@ - - org.smartboot.servlet + tech.smartboot.jakarta smart-servlet-spring-boot-starter 1.5 - - - - - + + org.springframework.boot + spring-boot-starter-undertow + 3.3.1 + - - - - - - - + + + + + + + diff --git a/springboot-demo/src/main/java/org/smartboot/demo/starter/Bootstrap.java b/springboot-demo/src/main/java/org/smartboot/demo/starter/Bootstrap.java index d9c1e11f5f86b98adf5af5c391ce1567ee008a92..4692d51c2aa97be99fe88f89e95e281ede4565d8 100644 --- a/springboot-demo/src/main/java/org/smartboot/demo/starter/Bootstrap.java +++ b/springboot-demo/src/main/java/org/smartboot/demo/starter/Bootstrap.java @@ -17,10 +17,10 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.SessionAttribute; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import java.security.Principal; import java.util.Date; diff --git a/springboot-demo/src/main/java/org/smartboot/demo/starter/SecurityConfig.java b/springboot-demo/src/main/java/org/smartboot/demo/starter/SecurityConfig.java index 3df0c40735bb51edebaf2e6a57415d6af2b813cd..8e44c4c1369dd540f1d0adae5c3725b7c6b16119 100644 --- a/springboot-demo/src/main/java/org/smartboot/demo/starter/SecurityConfig.java +++ b/springboot-demo/src/main/java/org/smartboot/demo/starter/SecurityConfig.java @@ -15,18 +15,18 @@ import org.springframework.security.web.SecurityFilterChain; @EnableWebSecurity public class SecurityConfig { - @Bean - public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - http - .authorizeHttpRequests((authorize) -> authorize - .mvcMatchers("/index").hasRole("USER") - .mvcMatchers("/hello/world").hasRole("ADMIN") - .mvcMatchers("/").authenticated() - ) - .httpBasic(); - - return http.build(); - } +// @Bean +// public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { +// http +// .authorizeHttpRequests((authorize) -> authorize +// .mvcMatchers("/index").hasRole("USER") +// .mvcMatchers("/hello/world").hasRole("ADMIN") +// .mvcMatchers("/").authenticated() +// ) +// .httpBasic(); +// +// return http.build(); +// } @Bean public UserDetailsService userDetailsService() { diff --git a/tck/pom.xml b/tck/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..450dcddc99c14345e875b6390978f57d78f5ddb9 --- /dev/null +++ b/tck/pom.xml @@ -0,0 +1,268 @@ + + + + 4.0.0 + + tech.smartboot.jakarta.tck + servlet-tck-run + 1.0.0-SNAPSHOT + + tck-build + + + UTF-8 + 11 + 11 + 5.10.3 + 1.7.36 + 6.1.0 + 6.1.0 + -Xmx8g -Xms4g + + + + false + same_thread + concurrent + fixed + 2 + false + 1.5 + + + + + + tech.smartboot.jakarta + servlet-core + 1.5 + + + tech.smartboot.jakarta.enterprise + base + 1.5 + + + org.junit + junit-bom + ${junit.version} + pom + import + + + org.jboss.arquillian + arquillian-bom + 1.8.1.Final + pom + import + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-bom + 3.3.0 + pom + import + + + + + + + jakarta.tck + servlet-tck-runtime + 6.1.0 + + + commons-logging + * + + + org.glassfish.metro + * + + + + + jakarta.servlet + jakarta.servlet-api + ${servlet.api.version} + + + org.junit.jupiter + junit-jupiter + test + + + org.junit.vintage + junit-vintage-engine + test + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.slf4j + jul-to-slf4j + ${slf4j.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + + + org.jboss.arquillian.container + arquillian-container-test-spi + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + test + + + + + tech.smartboot.jakarta + servlet-core + + + + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.4.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 3.3.0 + + + ${fork.argLine} -Duser.language=en -Duser.country=US -Djava.locale.providers=COMPAT,CLDR + -Djava.protocol.handler.pkgs=javax.net.ssl + -Djavax.net.ssl.keyStore=${project.build.testOutputDirectory}/certificates/clientcert.jks + -Djavax.net.ssl.keyStorePassword=changeit + -Djavax.net.ssl.trustStore=${project.build.directory}/cacerts.jks + 15000 + + jakarta.tck:servlet-tck-runtime + + + ${http2.timeout} + false + + + + + + + + + false + + + junit.jupiter.execution.parallel.enabled=${junit.jupiter.execution.parallel.enabled} + junit.jupiter.execution.parallel.mode.default=${junit.jupiter.execution.parallel.mode.default} + junit.jupiter.execution.parallel.mode.classes.default=${junit.jupiter.execution.parallel.mode.classes.default} + junit.jupiter.execution.parallel.config.strategy=${junit.jupiter.execution.parallel.config.strategy} + junit.jupiter.execution.parallel.config.fixed.parallelism=${junit.jupiter.execution.parallel.config.fixed.parallelism} + junit.jupiter.extensions.autodetection.enabled=${junit.jupiter.extensions.autodetection.enabled} + + + + + + org.basepom.maven + duplicate-finder-maven-plugin + 2.0.1 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.7.1 + + + unpack + generate-test-resources + + unpack + + + + + jakarta.tck + servlet-tck-runtime + jar + true + ${project.build.testOutputDirectory}/ + **/**cts_cert,**/**clientcert.jks,**/**clientcert.p12 + + + + + + + + org.codehaus.mojo + keytool-maven-plugin + 1.7 + + + + importCertificate + + process-test-resources + + + + + true + cts + CN=CTS, OU=Java Software, O=Sun Microsystems Inc., L=Burlington, ST=MA, C=US + ${project.build.testOutputDirectory}/certificates/cts_cert + JKS + ${project.build.directory}/cacerts.jks + changeit + changeit + true + + + + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + 3.0.0-M5 + + + + diff --git a/tck/src/main/java/tech/smartboot/jakarta/tck/ArquillianAppProvider.java b/tck/src/main/java/tech/smartboot/jakarta/tck/ArquillianAppProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..bf54be83e45ee55486ab7e275a32d7a29bff026f --- /dev/null +++ b/tck/src/main/java/tech/smartboot/jakarta/tck/ArquillianAppProvider.java @@ -0,0 +1,127 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ + +package tech.smartboot.jakarta.tck; + +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.util.WarUtil; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.logging.Logger; + +public class ArquillianAppProvider { + private static final Logger LOG = Logger.getLogger(ArquillianAppProvider.class.getName()); + + /** + * The prefix assigned to the temporary file where the archive is exported + */ + private static final String EXPORT_FILE_PREFIX = "export"; + + /** + * Directory into which we'll extract export the war files + */ + private static final File EXPORT_DIR; + + static { + /* + * Use of java.io.tmpdir Should be a last-resort fallback for temp directory. + * + * Use of java.io.tmpdir on CI systems is dangerous (overwrite possibility is extremely high) + * + * Use of java.io.tmpdir on Unix systems is unreliable (due to common /tmp dir cleanup processes) + */ + File systemDefaultTmpDir = new File(System.getProperty("java.io.tmpdir")); + + // If running under maven + surefire, use information provided by surefire. + String baseDirVal = System.getProperty("basedir"); + + File mavenTmpDir = null; + if (baseDirVal != null) { + File baseDir = new File(baseDirVal); + if (baseDir.exists() && baseDir.isDirectory()) { + File targetDir = new File(baseDir, "target"); + if (targetDir.exists() && targetDir.isDirectory()) { + mavenTmpDir = new File(targetDir, "arquillian-smart-servlet-temp"); + mavenTmpDir.mkdirs(); + } + } + } + + if ((mavenTmpDir != null) && mavenTmpDir.exists() && mavenTmpDir.isDirectory()) { + EXPORT_DIR = mavenTmpDir; + } else { + EXPORT_DIR = systemDefaultTmpDir; + } + + // If the temp location doesn't exist or isn't a directory + if (!EXPORT_DIR.exists() || !EXPORT_DIR.isDirectory()) { + throw new IllegalStateException("Could not obtain export directory \"" + EXPORT_DIR.getAbsolutePath() + "\""); + } + } + + private final SmartEmbeddedConfiguration config; + + public ArquillianAppProvider(SmartEmbeddedConfiguration config) { + this.config = config; + } + + protected ServletContextRuntime createApp(Container containerRuntime, final Archive archive) throws Exception { + String name = archive.getName(); + int extOff = name.lastIndexOf('.'); + if (extOff <= 0) { + throw new RuntimeException("Not a valid Web Archive filename: " + name); + } + String ext = name.substring(extOff).toLowerCase(); + if (!ext.equals(".war")) { + throw new RuntimeException("Not a recognized Web Archive: " + name); + } + name = name.substring(0, extOff); + + final File exported; + try { + if (this.config.isUseArchiveNameAsContext()) { + Path tmpDirectory = Files.createTempDirectory("arquillian-jetty"); + Path archivePath = tmpDirectory.resolveSibling(archive.getName()); + Files.deleteIfExists(archivePath); + exported = Files.createFile(archivePath).toFile(); + exported.deleteOnExit(); + } else { + // If this method returns successfully then it is guaranteed that: + // 1. The file denoted by the returned abstract pathname did not exist before this method was invoked, and + // 2. Neither this method nor any of its variants will return the same abstract pathname again in the current invocation of the virtual machine. + exported = File.createTempFile(EXPORT_FILE_PREFIX, archive.getName(), EXPORT_DIR); + } + } catch (IOException e) { + throw new RuntimeException("Could not create temporary File in " + EXPORT_DIR + " to write exported archive", + e); + } + // We are overwriting the temporary file placeholder reserved by File#createTemplateFile() + archive.as(ZipExporter.class).exportTo(exported, true); + + // Mark to delete when we come down + // exported.deleteOnExit(); + + // Add the context + URI uri = exported.toURI(); + LOG.info("Webapp archive location: " + uri.toASCIIString()); + File dirFile = new File(exported.getParentFile(), name); + System.out.println("开始解压[" + name + "]..."); + WarUtil.unZip(exported, dirFile); + return containerRuntime.addRuntime(dirFile.getAbsolutePath(), "/" + name); + } + +} diff --git a/tck/src/main/java/tech/smartboot/jakarta/tck/SmartEmbeddedConfiguration.java b/tck/src/main/java/tech/smartboot/jakarta/tck/SmartEmbeddedConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..327b1fa313f0acff3a98affacb394a2afbe220c4 --- /dev/null +++ b/tck/src/main/java/tech/smartboot/jakarta/tck/SmartEmbeddedConfiguration.java @@ -0,0 +1,380 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ +package tech.smartboot.jakarta.tck; + +import org.jboss.arquillian.container.spi.ConfigurationException; +import org.jboss.arquillian.container.spi.client.container.ContainerConfiguration; +import org.smartboot.http.server.HttpServerConfiguration; + +import java.io.File; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +/** + * A {@link ContainerConfiguration} common base for the Jetty Embedded + * containers + * + * @author Dan Allen + * @author Ales Justin + * @author Alex Soto + */ +public class SmartEmbeddedConfiguration implements ContainerConfiguration { + public enum ClassLoaderBehavior { + /** + * Default behavior for Java Spec (server classloader, then webapp). + *

+ * Also the default for Arquillian. + */ + JAVA_SPEC, + /** + * Default behavior for Servlet Spec (webapp classloader, then server) + */ + SERVLET_SPEC + } + + /** + * Classloader Search Order behavior. + *

+ */ + private ClassLoaderBehavior classloaderBehavior = ClassLoaderBehavior.JAVA_SPEC; + + /** + * Optional override for the default servlet spec descriptor + */ + private URI defaultsDescriptor; + + /** + * Dump, to System.err, the server state tree after the server has successfully started up. + */ + private boolean dumpServerAfterStart = false; + + /** + * Optional HttpConfiguration for the ServerConnector that Arquillian + * creates. + */ + private HttpServerConfiguration httpConfiguration; + + /** + * Idle Timeout (in milliseconds) for active connections. + *

+ * Default: 30,000ms + */ + private long idleTimeoutMillis = 30000; + + /** + * Base directory for all temp files that Jetty will manage. + */ + private File tempDirectory; + + public ClassLoaderBehavior getClassloaderBehavior() { + return classloaderBehavior; + } + + public URI getDefaultsDescriptor() { + return defaultsDescriptor; + } + + public HttpServerConfiguration getHttpConfiguration() { + return httpConfiguration; + } + + public long getIdleTimeoutMillis() { + return idleTimeoutMillis; + } + + public File getTempDirectory() { + return tempDirectory; + } + + public boolean hasDefaultsDescriptor() { + return (defaultsDescriptor != null); + } + + public boolean isDumpServerAfterStart() { + return dumpServerAfterStart; + } + + public void setClassloaderBehavior(ClassLoaderBehavior classloaderBehavior) { + this.classloaderBehavior = classloaderBehavior; + } + + public void setDefaultsDescriptor(URI defaultsDescriptor) { + this.defaultsDescriptor = defaultsDescriptor; + } + + public void setDumpServerAfterStart(boolean serverDumpAfterStart) { + this.dumpServerAfterStart = serverDumpAfterStart; + } + + public void setHttpConfiguration(HttpServerConfiguration httpConfiguration) { + this.httpConfiguration = httpConfiguration; + } + + public void setIdleTimeoutMillis(long milliseconds) { + this.idleTimeoutMillis = milliseconds; + } + + public void setTempDirectory(File tempDirectory) { + this.tempDirectory = tempDirectory; + } + + private String bindAddress = "localhost"; + + private int bindHttpPort = 9090; + + private Map mimeTypes; + + private Map inferredEncodings; + + private int headerBufferSize = 0; + + private File realmProperties; + + /** + * List of server configuration classes that can be used for + * establishing the configuration tasks for the WebApp being deployed. + */ + private String configurationClasses; + + private String requestCookieCompliance; + + private String responseCookieCompliance; + + private boolean useArchiveNameAsContext; + + private boolean ssl; + + private boolean h2cEnabled; + + /** + * Path to keystore file + */ + private String keystorePath; + + private String keystorePassword; + + private String trustStorePath; + + private String trustStorePassword; + + private boolean sniRequired; + + private boolean sniHostCheck; + + private boolean needClientAuth; + + /* + * (non-Javadoc) + * + * @see org.jboss.arquillian.spi.client.container.ContainerConfiguration#validate() + */ + public void validate() throws ConfigurationException { + if (this.realmProperties != null) { + if (!this.realmProperties.exists()) { + throw new ConfigurationException( + String.format("Realm properties file %s must exists.", this.realmProperties.getAbsolutePath())); + } + if (this.realmProperties.isDirectory()) { + throw new ConfigurationException("Realm Properties should be a file and not a directory"); + } + } + } + + public int getBindHttpPort() { + return bindHttpPort; + } + + public void setBindHttpPort(int bindHttpPort) { + this.bindHttpPort = bindHttpPort; + } + + public String getBindAddress() { + return bindAddress; + } + + public void setBindAddress(String bindAddress) { + this.bindAddress = bindAddress; + } + + public String getConfigurationClasses() { + return configurationClasses; + } + + /** + * @param configurationClasses A comma separated list of fully qualified configuration classes + */ + public void setConfigurationClasses(String configurationClasses) { + this.configurationClasses = configurationClasses; + } + + public int getHeaderBufferSize() { + return this.headerBufferSize; + } + + public boolean isHeaderBufferSizeSet() { + return this.headerBufferSize > 0; + } + + public void setHeaderBufferSize(int headerBufferSize) { + this.headerBufferSize = headerBufferSize; + } + + public void setRealmProperties(String realmProperties) { + this.realmProperties = new File(realmProperties); + } + + public boolean isRealmPropertiesFileSet() { + return this.realmProperties != null; + } + + public File getRealmProperties() { + return realmProperties; + } + + public void setMimeTypes(String mimeTypes) { + this.mimeTypes = new HashMap<>(); + String[] splittedLines = mimeTypes.split(" "); + for (int i = 0; i < splittedLines.length; i += 2) { + if (i + 1 >= splittedLines.length) { + throw new ConfigurationException(String.format( + "Mime Type definition should follow the format [ ]*, for example js application/javascript but %s definition has been found.", + mimeTypes)); + } + this.mimeTypes.put(splittedLines[i], splittedLines[i + 1]); + } + } + + public boolean areMimeTypesSet() { + return this.mimeTypes != null; + } + + public Map getMimeTypes() { + return mimeTypes; + } + + public String getRequestCookieCompliance() { + return requestCookieCompliance; + } + + public void setRequestCookieCompliance(String requestCookieCompliance) { + this.requestCookieCompliance = requestCookieCompliance; + } + + public String getResponseCookieCompliance() { + return responseCookieCompliance; + } + + public void setResponseCookieCompliance(String responseCookieCompliance) { + this.responseCookieCompliance = responseCookieCompliance; + } + + public boolean isUseArchiveNameAsContext() { + return useArchiveNameAsContext; + } + + public void setUseArchiveNameAsContext(boolean useArchiveNameAsContext) { + this.useArchiveNameAsContext = useArchiveNameAsContext; + } + + public void setInferredEncodings(String inferredEncodings) { + this.inferredEncodings = new HashMap<>(); + String[] splittedLines = inferredEncodings.split(" "); + for (int i = 0; i < splittedLines.length; i += 2) { + if (i + 1 >= splittedLines.length) { + throw new ConfigurationException(String.format( + "Mime Type definition should follow the format [ ]*, for example js application/javascript but %s definition has been found.", + inferredEncodings)); + } + this.inferredEncodings.put(splittedLines[i], splittedLines[i + 1]); + } + } + + public boolean areInferredEncodings() { + return this.inferredEncodings != null; + } + + public Map getInferredEncodings() { + return inferredEncodings; + } + + public boolean isSsl() { + return ssl; + } + + public void setSsl(boolean ssl) { + this.ssl = ssl; + } + + public String getKeystorePath() { + return keystorePath; + } + + public void setKeystorePath(String keystorePath) { + this.keystorePath = keystorePath; + } + + public String getKeystorePassword() { + return keystorePassword; + } + + public void setKeystorePassword(String keystorePassword) { + this.keystorePassword = keystorePassword; + } + + public String getTrustStorePath() { + return trustStorePath; + } + + public void setTrustStorePath(String trustStorePath) { + this.trustStorePath = trustStorePath; + } + + public String getTrustStorePassword() { + return trustStorePassword; + } + + public void setTrustStorePassword(String trustStorePassword) { + this.trustStorePassword = trustStorePassword; + } + + public boolean isSniRequired() { + return sniRequired; + } + + public void setSniRequired(boolean sniRequired) { + this.sniRequired = sniRequired; + } + + public boolean isSniHostCheck() { + return sniHostCheck; + } + + public void setSniHostCheck(boolean sniHostCheck) { + this.sniHostCheck = sniHostCheck; + } + + public boolean isNeedClientAuth() { + return needClientAuth; + } + + public void setNeedClientAuth(boolean needClientAuth) { + this.needClientAuth = needClientAuth; + } + + public boolean isH2cEnabled() { + return h2cEnabled; + } + + public void setH2cEnabled(boolean h2cEnabled) { + this.h2cEnabled = h2cEnabled; + } +} + diff --git a/tck/src/main/java/tech/smartboot/jakarta/tck/SmartEmbeddedContainer.java b/tck/src/main/java/tech/smartboot/jakarta/tck/SmartEmbeddedContainer.java new file mode 100644 index 0000000000000000000000000000000000000000..2d067ac99fcb34c9a744e7ad8d8da6fc230a9798 --- /dev/null +++ b/tck/src/main/java/tech/smartboot/jakarta/tck/SmartEmbeddedContainer.java @@ -0,0 +1,182 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ +package tech.smartboot.jakarta.tck; + +import jakarta.servlet.ServletContext; +import org.jboss.arquillian.container.spi.client.container.DeployableContainer; +import org.jboss.arquillian.container.spi.client.container.DeploymentException; +import org.jboss.arquillian.container.spi.client.container.LifecycleException; +import org.jboss.arquillian.container.spi.client.protocol.ProtocolDescription; +import org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext; +import org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData; +import org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet; +import org.jboss.arquillian.container.spi.context.annotation.DeploymentScoped; +import org.jboss.arquillian.core.api.InstanceProducer; +import org.jboss.arquillian.core.api.annotation.ApplicationScoped; +import org.jboss.arquillian.core.api.annotation.Inject; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.descriptor.api.Descriptor; +import org.smartboot.http.common.codec.websocket.CloseReason; +import org.smartboot.http.server.HttpBootstrap; +import org.smartboot.http.server.HttpRequest; +import org.smartboot.http.server.HttpResponse; +import org.smartboot.http.server.HttpServerHandler; +import org.smartboot.http.server.WebSocketHandler; +import org.smartboot.http.server.WebSocketRequest; +import org.smartboot.http.server.WebSocketResponse; +import org.smartboot.http.server.impl.WebSocketRequestImpl; +import org.smartboot.http.server.impl.WebSocketResponseImpl; +import tech.smartboot.jakarta.Container; +import tech.smartboot.jakarta.ServletContextRuntime; +import tech.smartboot.jakarta.conf.ServletInfo; +import tech.smartboot.jakarta.provider.WebsocketProvider; + +import java.util.concurrent.CompletableFuture; + +public class SmartEmbeddedContainer implements DeployableContainer { + + private HttpBootstrap bootstrap; + private Container containerRuntime; + private ArquillianAppProvider appProvider; + + private SmartEmbeddedConfiguration containerConfig; + + private String listeningHost; + private int listeningPort; + + @Inject + @DeploymentScoped + private InstanceProducer webAppContextProducer; + + @Inject + @ApplicationScoped + private InstanceProducer servletContextInstanceProducer; + + /* + * (non-Javadoc) + * + * @see org.jboss.arquillian.spi.client.container.DeployableContainer#getConfigurationClass() + */ + public Class getConfigurationClass() { + return SmartEmbeddedConfiguration.class; + } + + /* + * (non-Javadoc) + * + * @see org.jboss.arquillian.spi.client.container.DeployableContainer#getDefaultProtocol() + */ + public ProtocolDescription getDefaultProtocol() { + // Jetty 9 is a Servlet 3.1 container. + // However, Arquillian "Protocol" actuall means "Packaging" + // TODO: Fix to servlet 3.1 (when available in arquillian) + return new ProtocolDescription("Servlet 3.0"); + } + + public void setup(SmartEmbeddedConfiguration containerConfig) { + this.containerConfig = containerConfig; + } + + public void start() throws LifecycleException { + appProvider = new ArquillianAppProvider(containerConfig); + this.bootstrap = new HttpBootstrap(); + containerRuntime = new Container(); + bootstrap.httpHandler(new HttpServerHandler() { + @Override + public void handle(HttpRequest request, HttpResponse response, CompletableFuture completableFuture) { + containerRuntime.doHandle(request, response, completableFuture); + } + }).webSocketHandler(new WebSocketHandler() { + @Override + public void whenHeaderComplete(WebSocketRequestImpl request, WebSocketResponseImpl response) { + CompletableFuture completableFuture = new CompletableFuture<>(); + try { + containerRuntime.doHandle(request, response, completableFuture); + } finally { + if (request.getAttachment() == null || request.getAttachment().get(WebsocketProvider.WEBSOCKET_SESSION_ATTACH_KEY) == null) { + response.close(CloseReason.UNEXPECTED_ERROR, ""); + } + } + } + + @Override + public void handle(WebSocketRequest request, WebSocketResponse response) { + containerRuntime.doHandle(request, response); + } + }); + bootstrap.configuration().bannerEnabled(false).readBufferSize(1024 * 1024).debug(true); + + try { + containerRuntime.start(this.bootstrap.configuration()); + } catch (Throwable e) { + throw new LifecycleException(e.getMessage(), e); + } + bootstrap.setPort(containerConfig.getBindHttpPort()).start(); + listeningHost = "127.0.0.1"; +// listeningHost = containerConfig.getBindAddress(); + listeningPort = containerConfig.getBindHttpPort(); + System.out.println("host: " + listeningHost + " port:" + listeningPort); + } + + + public void stop() throws LifecycleException { + try { + System.out.println("stop....."); + containerRuntime.stop(); + bootstrap.shutdown(); + } catch (Exception e) { + throw new LifecycleException("Could not stop container", e); + } + } + + /* + * (non-Javadoc) + * + * @see org.jboss.arquillian.spi.client.container.DeployableContainer#deploy(org.jboss.shrinkwrap.descriptor.api.Descriptor) + */ + public void deploy(Descriptor descriptor) throws DeploymentException { + throw new UnsupportedOperationException("Not implemented"); + } + + /* + * (non-Javadoc) + * + * @see org.jboss.arquillian.spi.client.container.DeployableContainer#undeploy(org.jboss.shrinkwrap.descriptor.api.Descriptor) + */ + public void undeploy(Descriptor descriptor) throws DeploymentException { + throw new UnsupportedOperationException("Not implemented"); + } + + public ProtocolMetaData deploy(final Archive archive) throws DeploymentException { + try { + ServletContextRuntime app = appProvider.createApp(containerRuntime, archive); + + app.start(); + + webAppContextProducer.set(app); + servletContextInstanceProducer.set(app.getServletContext()); + + HTTPContext httpContext = new HTTPContext(listeningHost, listeningPort); + for (ServletInfo servlet : app.getDeploymentInfo().getServlets().values()) { + httpContext.add(new Servlet(servlet.getServletName(), app.getContextPath())); + } + return new ProtocolMetaData().addContext(httpContext); + } catch (Throwable e) { + throw new DeploymentException("Could not deploy " + archive.getName(), e); + } + } + + public void undeploy(Archive archive) throws DeploymentException { + ServletContextRuntime app = webAppContextProducer.get(); + if (app != null) { + app.stop(); + } + } +} diff --git a/tck/src/main/java/tech/smartboot/jakarta/tck/SmartServletExtension.java b/tck/src/main/java/tech/smartboot/jakarta/tck/SmartServletExtension.java new file mode 100644 index 0000000000000000000000000000000000000000..f573a1ea726ad9a1c8f39f413c18dcfb637eaa8d --- /dev/null +++ b/tck/src/main/java/tech/smartboot/jakarta/tck/SmartServletExtension.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) [2022] smartboot [zhengjunweimail@163.com] + * + * 企业用户未经smartboot组织特别许可,需遵循AGPL-3.0开源协议合理合法使用本项目。 + * + * Enterprise users are required to use this project reasonably + * and legally in accordance with the AGPL-3.0 open source agreement + * without special permission from the smartboot organization. + */ +package tech.smartboot.jakarta.tck; + +import org.jboss.arquillian.container.spi.client.container.DeployableContainer; +import org.jboss.arquillian.core.spi.LoadableExtension; + +/** + * Jetty Embedded 10.x extension. + * + * @author Aslak Knutsen + */ +public class SmartServletExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder builder) { + builder.service(DeployableContainer.class, SmartEmbeddedContainer.class); + } +} diff --git a/tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 0000000000000000000000000000000000000000..fa37833ceb23895b9726fd09984c30d19c69c3e9 --- /dev/null +++ b/tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1 @@ +tech.smartboot.jakarta.tck.SmartServletExtension \ No newline at end of file diff --git a/tck/src/test/resources/arquillian.xml b/tck/src/test/resources/arquillian.xml new file mode 100644 index 0000000000000000000000000000000000000000..e777093ee3bbc267f3f5eaa171e5cb372fad1013 --- /dev/null +++ b/tck/src/test/resources/arquillian.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + 8080 + + RFC6265 + + RFC6265 + src/test/resources/default.properties + true + + text/html iso-8859-1 + + true + + relativeRedirectAllowed false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tck/src/test/resources/default.properties b/tck/src/test/resources/default.properties new file mode 100644 index 0000000000000000000000000000000000000000..828c87fc3de956e72f0296f9fb8faf3dee65e23f --- /dev/null +++ b/tck/src/test/resources/default.properties @@ -0,0 +1,27 @@ +# +# This file defines users passwords and roles for a HashUserRealm +# +# The format is +# : [, ...] +# +# Passwords may be clear text, obfuscated or checksummed. The class +# org.eclipse.util.Password should be used to generate obfuscated +# passwords or password checksums +# +# If DIGEST Authentication is used, the password must be in a recoverable +# format, either plain text or OBF:. +# +jetty: MD5:164c88b302622e17050af52c89945d44,user +admin: CRYPT:adpexzg3FUZAk,server-administrator,content-administrator,admin,user +other: OBF:1xmk1w261u9r1w1c1xmq,user +plain: plain,user +user: password,user + +# This entry is for digest auth. The credential is a MD5 hash of username:realmname:password +digest: MD5:6e120743ad67abfbc385bc2bb754e297,user + +j2ee: j2ee,Administrator,Employee +javajoe: javajoe,VP,Manager + +# CN=CTS, OU=Java Software, O=Sun Microsystems Inc., L=Burlington, ST=MA, C=US +CN\=CTS,\ OU\=Java\ Software,\ O\=Sun\ Microsystems\ Inc.,\ L\=Burlington,\ ST\=MA,\ C\=US=,,Administrator \ No newline at end of file diff --git a/tck/src/test/resources/servlet_spec_fragment_web/webdefault.xml b/tck/src/test/resources/servlet_spec_fragment_web/webdefault.xml new file mode 100644 index 0000000000000000000000000000000000000000..e2f60d3c236bc1aef836ed5ca8139e46adbe9ce9 --- /dev/null +++ b/tck/src/test/resources/servlet_spec_fragment_web/webdefault.xml @@ -0,0 +1,435 @@ + + + + + + + + + + + + + + + + + + + + + + + Default web.xml file. + This file is applied to a Web application before its own WEB_INF/web.xml file + + + + + + + + org.eclipse.jetty.ee10.servlet.listener.IntrospectorCleaner + + + + + + + + + + + + + + + + + default + org.eclipse.jetty.ee10.servlet.DefaultServlet + + acceptRanges + true + + + dirAllowed + true + + + welcomeServlets + exact + + + redirectWelcome + false + + + maxCacheSize + 256000000 + + + maxCachedFileSize + 200000000 + + + maxCachedFiles + 2048 + + + etags + false + + + useFileMappedBuffer + true + + 0 + + + + default + / + + + + + + + + + + + + + + + jsp + org.eclipse.jetty.ee10.jsp.JettyJspServlet + + xpoweredBy + false + + + compilerTargetVM + 1.8 + + + compilerSourceVM + 1.8 + + 0 + + + + jsp + *.jsp + *.jspf + *.jspx + *.xsp + *.JSP + *.JSPF + *.JSPX + *.XSP + + + + + + + + 30 + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + + + + + + ar + ISO-8859-6 + + + be + ISO-8859-5 + + + bg + ISO-8859-5 + + + ca + ISO-8859-1 + + + cs + ISO-8859-2 + + + da + ISO-8859-1 + + + de + ISO-8859-1 + + + el + ISO-8859-7 + + + en + ISO-8859-1 + + + es + ISO-8859-1 + + + et + ISO-8859-1 + + + fi + ISO-8859-1 + + + fr + ISO-8859-1 + + + hr + ISO-8859-2 + + + hu + ISO-8859-2 + + + is + ISO-8859-1 + + + it + ISO-8859-1 + + + iw + ISO-8859-8 + + + ja + Shift_JIS + + + ko + EUC-KR + + + lt + ISO-8859-2 + + + lv + ISO-8859-2 + + + mk + ISO-8859-5 + + + nl + ISO-8859-1 + + + no + ISO-8859-1 + + + pl + ISO-8859-2 + + + pt + ISO-8859-1 + + + ro + ISO-8859-2 + + + ru + ISO-8859-5 + + + sh + ISO-8859-5 + + + sk + ISO-8859-2 + + + sl + ISO-8859-2 + + + sq + ISO-8859-2 + + + sr + ISO-8859-5 + + + sv + ISO-8859-1 + + + tr + ISO-8859-9 + + + uk + ISO-8859-5 + + + zh + GB2312 + + + zh_TW + Big5 + + + + + + + + + Disable TRACE + / + TRACE + + + + + + Enable everything but TRACE + / + TRACE + + + + + diff --git a/tck/src/test/resources/simplelogger.properties b/tck/src/test/resources/simplelogger.properties new file mode 100644 index 0000000000000000000000000000000000000000..c42caf080b586f0d20afc650927bc85f6661b3a4 --- /dev/null +++ b/tck/src/test/resources/simplelogger.properties @@ -0,0 +1,8 @@ +org.slf4j.simpleLogger.defaultLogLevel=info +#org.slf4j.simpleLogger.log.org.eclipse.jetty=debug +#org.slf4j.simpleLogger.log.org.eclipse.jetty.security=info +#org.slf4j.simpleLogger.log.org.eclipse.jetty.annotations=debug +org.slf4j.simpleLogger.log.org.eclipse.jetty.io=info +org.slf4j.simpleLogger.log.org.eclipse.jetty.server=info +org.slf4j.simpleLogger.log.org.eclipse.jetty.util=info +