Skip to content

8294872: Document "resource" protocol - #2251

Open
sashamatveev wants to merge 2 commits into
openjdk:masterfrom
sashamatveev:JDK-8294872
Open

8294872: Document "resource" protocol#2251
sashamatveev wants to merge 2 commits into
openjdk:masterfrom
sashamatveev:JDK-8294872

Conversation

@sashamatveev

@sashamatveev sashamatveev commented Aug 6, 2026

Copy link
Copy Markdown
Member
  • Added documentation for "resource" protocol.
  • "resource" protocol was added with JDK-8238755 to support GraalVM native-image.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issues

  • JDK-8294872: Document "resource" protocol (Task - P3)
  • JDK-8374836: Media: add missing jrt protocol to javadoc (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/2251/head:pull/2251
$ git checkout pull/2251

Update a local copy of the PR:
$ git checkout pull/2251
$ git pull https://git.openjdk.org/jfx.git pull/2251/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2251

View PR using the GUI difftool:
$ git pr show -t 2251

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/2251.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 6, 2026

Copy link
Copy Markdown

👋 Welcome back almatvee! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the rfr Ready for review label Aug 6, 2026
@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: rfr. This can be overridden with the /reviewers command.

@mlbridge

mlbridge Bot commented Aug 6, 2026

Copy link
Copy Markdown

Webrevs

* <li>The supplied URI must conform to RFC-2396 as required by
* <A href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</A>.</li>
* <li>Only HTTP, HTTPS, FILE, and JAR URIs are supported.</li>
* <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</a>.</li>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we referencing java8 docs?
shouldn't it be a relative ref?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URI is not part of JavaFX, so we cannot use relative ref. Also, I found that JavaFX docs a published in several places, so using something like "../../URI.html" will not work.

I can update Java 8 links to latest, but I am not sure what policy we have in term of referencing old JDK releases and should we keep updating it to latest docs with each release. For example JavaFX 27 will point to JDK 27 docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle is configured to generate Javadocs with links to the documentation for the supported JDK version.

See:

Therefore, you should be able to replace:

<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html">java.net.URI</a>

with:

{@link java.net.URI}

* for more information about URI formatting in general.
* JAR URL syntax is specified in <a href="https://docs.oracle.com/javase/8/docs/api/java/net/JarURLConnection.html">java.net.JarURLConnection</A>.
* JAR URL syntax is specified in <a href="https://docs.oracle.com/javase/8/docs/api/java/net/JarURLConnection.html">java.net.JarURLConnection</a>.
* RESOURCE URL syntax is specified in <a href="https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/URLProtocols/">URL Protocols in Native Image</a>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar question: why refer to graalvm.org?
shouldn't we point to some authoritative document instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this one https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/dynamic-features/URLProtocols/, but it does not point to latest as graalvm.org. I do not see any problems with pointing to graalvm.org. Is there any concerns?

* Constructs a <code>Media</code> instance. This is the only way to
* specify the media source. The source must represent a valid <code>URI</code>
* and is immutable. Only HTTP, HTTPS, FILE, and JAR <code>URL</code>s are supported. If the
* and is immutable. Only HTTP, HTTPS, FILE, JAR, and RESOURCE <code>URL</code>s are supported. If the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just out of curiosity, could we use the actual codes ("https:", "jar:", ...) instead of HTTPS, JAR, ...?

@sashamatveev

Copy link
Copy Markdown
Member Author

8294872: Document "resource" protocol

@sashamatveev

Copy link
Copy Markdown
Member Author

/issue add JDK-8374836

@openjdk

openjdk Bot commented Aug 8, 2026

Copy link
Copy Markdown

@sashamatveev
Adding additional issue to issue list: 8374836: Media: add missing jrt protocol to javadoc.

* @param source URL string from which to load the audio clip. This can be an
* HTTP, HTTPS, FILE or JAR source.
* <code>http</code>, <code>https</code>, <code>file</code>, <code>jar</code>,
* <code>jrt</code>, and <code>resource</code> source.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"resource source" is poorly phrased. suggestion:

Supported schemes are ....

*
* <table border="1">
* <caption>Supported Protocols Table</caption>
* <caption>Supported Schemes / Protocols Table</caption>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L119: the header says "Protocol" while the table lists schemes and protocols.

I understand there is some mixing of related things - for example, the "P" in HTTP is for "protocol", but "http" (or "http:") is a URI scheme.

So maybe revert adding "Schemes /" in L115,118 and just keep saying "protocol"?
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants