RFR: 8281104: jar --create should create missing parent directories

Christian Stein cstein at openjdk.java.net
Thu Feb 3 19:45:12 UTC 2022


On Wed, 2 Feb 2022 20:21:54 GMT, Christian Stein <cstein at openjdk.org> wrote:

> Calling `jar --create --file a/b/foo.jar INPUT-FILES` should create missing parent directories (here `a/b`) on the default file system before storing the JAR file (here `foo.jar`) in the destination directory.

Thanks for the review, Lance.

I didn't change order of creation, validation, and movement of the temporary JAR file in order to keep existing behaviour consistent.

A reason to use the main-based testing approach was also the ability to run the test via JEP 330:
`java CreateMissingParentDirectories.java`

> Also, we should update jar.properties to indicate that the directory path will be created as needed in the help section for jar.

That's a good point. Where would we put that information?
- [ ] Extend the descriptions of option `c`/`--create` and/or option `f`/`--file`?
- [ ] As a post scriptum note below the options?
  https://github.com/openjdk/jdk/blob/master/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties#L309-L317

-------------

PR: https://git.openjdk.java.net/jdk/pull/7327


More information about the core-libs-dev mailing list