Skip to content

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Nov 23, 2025

java.net.URL has been deprecated in recent Java versions, so this commit migrates all usages to the recommended java.net.URI class.

Changes:

  • ProtocolHelper.java: Convert URL to URI using toURI() method for ClassLoader resources, update protocol checks to use getScheme() instead of getProtocol()
  • FessXpathTransformer.java: Replace all URL instances with URI, use URI.create() and URI.resolve() for URL construction and relative URL resolution, update exception handling from MalformedURLException to IllegalArgumentException

Note: fess-crawler library changes are handled separately as mentioned by the user.

java.net.URL has been deprecated in recent Java versions, so this commit
migrates all usages to the recommended java.net.URI class.

Changes:
- ProtocolHelper.java: Convert URL to URI using toURI() method for
  ClassLoader resources, update protocol checks to use getScheme()
  instead of getProtocol()
- FessXpathTransformer.java: Replace all URL instances with URI,
  use URI.create() and URI.resolve() for URL construction and
  relative URL resolution, update exception handling from
  MalformedURLException to IllegalArgumentException

Note: fess-crawler library changes are handled separately as mentioned
by the user.
Add URL-to-URI conversion layer to maintain compatibility with the
fess-crawler parent class (XpathTransformer) which still uses
java.net.URL.

Changes:
- getBaseUrl(): Return URL instead of URI, internally use URI.toURL()
- addChildUrlFromTagAttribute(): Accept URL parameter and convert to
  URI internally for modern URL handling
- This allows internal use of URI while maintaining API compatibility
  with the parent class

Note: Once fess-crawler is updated to use URI, these compatibility
conversions can be removed.
@marevol marevol force-pushed the claude/migrate-url-to-uri-01EHW3q58TFX2EDC9qE4gNsG branch from 05f7232 to d3a1596 Compare November 23, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants