Skip to content

Commit

Permalink
change servlet namespace to jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Nov 19, 2024
1 parent 0c3a5a1 commit 4bec333
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply plugin: 'com.google.cloud.tools.appengine-appenginewebxml'

compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '21'
}
}

Expand All @@ -38,7 +38,7 @@ sourceSets {

dependencies {
implementation 'com.google.appengine:appengine-api-1.0-sdk:+'
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
providedCompile 'jakarta.servlet:jakarta.servlet-api:5.0.0'
implementation 'com.atlassian.commonmark:commonmark:0.17.0'
implementation 'com.github.scribejava:scribejava-apis:8.3.1'
implementation 'com.google.code.gson:gson:2.8.9'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
4 changes: 2 additions & 2 deletions src/photos/LocalContent.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package photos

import jakarta.servlet.ServletContext
import org.commonmark.parser.Parser
import org.commonmark.renderer.html.HtmlRenderer
import java.io.File
import javax.servlet.ServletContext

class LocalContent(path: String?) {
constructor(servletContext: ServletContext): this(servletContext.getRealPath("content"))
Expand Down Expand Up @@ -34,4 +34,4 @@ class LocalContent(path: String?) {
fun forAlbum(albumName: String?) = albums[albumName]
}

data class AlbumContent(val content: String?, val geo: GeoLocation?)
data class AlbumContent(val content: String?, val geo: GeoLocation?)
4 changes: 2 additions & 2 deletions src/web/Renderer.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package web

import javax.servlet.http.HttpServletResponse
import jakarta.servlet.http.HttpServletResponse

open class Renderer {
open operator fun invoke(response: HttpServletResponse, lastModified: Long? = null, html: () -> String) {
Expand All @@ -12,4 +12,4 @@ open class Renderer {

response.writer.write(html())
}
}
}
10 changes: 5 additions & 5 deletions src/web/RequestFilter.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package web

import integration.OAuth
import jakarta.servlet.*
import jakarta.servlet.annotation.WebFilter
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import photos.LocalContent
import photos.Picasa
import javax.servlet.*
import javax.servlet.annotation.WebFilter
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

@WebFilter("/*")
class RequestFilter : Filter {
Expand All @@ -23,4 +23,4 @@ class RequestFilter : Filter {
}

override fun destroy() { }
}
}
10 changes: 5 additions & 5 deletions src/web/RequestRouter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package web

import integration.BackgroundTasks
import integration.OAuth
import jakarta.servlet.FilterChain
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import jakarta.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY
import jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND
import photos.AlbumPart
import photos.Cache
import photos.Picasa
import java.util.*
import javax.servlet.FilterChain
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY
import javax.servlet.http.HttpServletResponse.SC_NOT_FOUND

class RequestRouter(
val req: HttpServletRequest,
Expand Down
8 changes: 4 additions & 4 deletions src/web/RobotsServlet.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package web

import javax.servlet.annotation.WebServlet
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import jakarta.servlet.annotation.WebServlet
import jakarta.servlet.http.HttpServlet
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse

@WebServlet("/robots.txt")
class RobotsServlet : HttpServlet() {
Expand Down
10 changes: 5 additions & 5 deletions src/web/SiteMapServlet.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package web

import integration.OAuth
import jakarta.servlet.ServletConfig
import jakarta.servlet.annotation.WebServlet
import jakarta.servlet.http.HttpServlet
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import photos.LocalContent
import photos.Picasa
import views.sitemap
import javax.servlet.ServletConfig
import javax.servlet.annotation.WebServlet
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

@WebServlet("/sitemap.xml")
class SiteMapServlet : HttpServlet() {
Expand Down
2 changes: 1 addition & 1 deletion test/photos/LocalContentTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package photos

import io.mockk.every
import io.mockk.mockk
import jakarta.servlet.ServletContext
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import javax.servlet.ServletContext

class LocalContentTest {
val servletContext = mockk<ServletContext>()
Expand Down
6 changes: 3 additions & 3 deletions test/web/RequestRouterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package web

import integration.OAuth
import io.mockk.*
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import jakarta.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import photos.Album
import photos.Photo
import photos.Picasa
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY

class RequestRouterTest {
val req = mockk<HttpServletRequest>(relaxed = true)
Expand Down
4 changes: 2 additions & 2 deletions web/WEB-INF/appengine-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>anton-photos</application>
<version>3</version>
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<url-stream-handler>urlfetch</url-stream-handler>
<sessions-enabled>false</sessions-enabled>
<system-properties>
Expand Down

0 comments on commit 4bec333

Please sign in to comment.