You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "vttranlina (via GitHub)" <gi...@apache.org> on 2024/04/09 04:52:07 UTC

[PR] Fix warning deprecate new URL in java 21 [james-project]

vttranlina opened a new pull request, #2193:
URL: https://github.com/apache/james-project/pull/2193

   - new URL -> new URI::toURL
   
   ref: https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/net/URL.html#%3Cinit%3E(java.lang.String


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] Fix warning deprecate new URL in java 21 [james-project]

Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on PR #2193:
URL: https://github.com/apache/james-project/pull/2193#issuecomment-2044556837

   > 
   > scala does not seem to like it somehow?
   
   missing import 
   my mistake when did by regex Intellij 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] Fix warning deprecate new URL in java 21 [james-project]

Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #2193:
URL: https://github.com/apache/james-project/pull/2193#discussion_r1558977813


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/SessionSupplier.scala:
##########
@@ -80,11 +78,11 @@ class SessionSupplier(capabilityFactories: Set[CapabilityFactory]) {
 }
 
 class JmapUrlEndpointResolver(val urlPrefixes: UrlPrefixes) {
-  val apiUrl: URL = new URI(urlPrefixes.httpUrlPrefix.toString + "/jmap").toURL
+  val apiUrl: URL = URL(urlPrefixes.httpUrlPrefix.toString + "/jmap")
 
-  val downloadUrl: URL = new URI(urlPrefixes.httpUrlPrefix.toString + "/download/{accountId}/{blobId}?type={type}&name={name}").toURL
+  val downloadUrl: URL = URL(urlPrefixes.httpUrlPrefix.toString + "/download/{accountId}/{blobId}?type={type}&name={name}")

Review Comment:
   URI does not accept inputs containing {} characters. Upon examination, I verified that: apiUrl, downloadUrl, uploadUrl, eventSourceUrl, exclusively for session responses. Simple text (String) suffices for this purpose. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] Fix warning deprecate new URL in java 21 [james-project]

Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #2193:
URL: https://github.com/apache/james-project/pull/2193#discussion_r1557534660


##########
server/container/core/src/main/java/org/apache/james/server/core/filesystem/ResourceFactory.java:
##########
@@ -59,15 +57,15 @@ public Resource getResource(String fileURL) {
             try {
                 // Try to parse the location as a URL...
                 return handleUrlResource(fileURL);
-            } catch (MalformedURLException | URISyntaxException ex) {
+            } catch (MalformedURLException ex) {
                 // No URL -> resolve as resource path.
                 return new ClassPathResource(fileURL);
             }
         }
     }
 
-    private Resource handleUrlResource(String fileURL) throws MalformedURLException, URISyntaxException {
-        URL url = new URI(fileURL).toURL();
+    private Resource handleUrlResource(String fileURL) throws MalformedURLException {
+        URL url = new URL(fileURL);

Review Comment:
   the logic for handler UrlResource is more complicated than I think -> I revert it now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] Fix warning deprecate new URL in java 21 [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2193:
URL: https://github.com/apache/james-project/pull/2193#issuecomment-2044377920

   ```
   07:28:11,144 [ERROR] /home/jenkins/jenkins-agent/workspace/james_ApacheJames_PR-2193/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/json/SessionSerializationTest.scala:52: error: not found: type URI
   
   07:28:11,144 [ERROR]   private val URL = new URI("http://james.org").toURL()
   ```
   scala does not seem to like it somehow?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] Fix warning deprecate new URL in java 21 [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael merged PR #2193:
URL: https://github.com/apache/james-project/pull/2193


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] Fix warning deprecate new URL in java 21 [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2193:
URL: https://github.com/apache/james-project/pull/2193#issuecomment-2046338753

   https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-2193/6/
   
   looks related


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org