<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Christoph<br class=""><div><blockquote type="cite" class=""><div class="">On Feb 13, 2019, at 5:30 PM, Langer, Christoph <<a href="mailto:christoph.langer@sap.com" class="">christoph.langer@sap.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Lance,<br class=""><br class="">thanks for looking.<br class=""><br class=""><blockquote type="cite" class="">Just starting to take a peek at this and noticed one quick thing in your test:<br class="">------------<br class="">Paths.get(System.getProperty("test.dir", "."), "testPosix.zip")<br class="">——————<br class=""><br class="">You do not need the test.dir property or the permission added to test.policy<br class="">to access it, just reference the jar and it will be created in user.dir which is<br class="">also writable.<br class=""></blockquote><br class="">Hm, I thought I didn't want to mess around in "user.dir" as it can be some more global directory where you wouldn't want to leave artefacts... To me "test.dir" feels cleaner. Are there other opinions about that?<br class=""></div></div></blockquote><div><br class=""></div>user.dir points to the scratch directory that test uses, so it is where you want to create the tests. Workspaces can sometimes be read only:</div><div><br class=""></div><div>For example:</div><div>——————</div><div><pre style="background-color: rgb(255, 255, 255);" class=""><font face="Helvetica" class=""> @Test<br class=""> <span style="color: rgb(0, 0, 128); font-weight: bold;" class="">public void </span>test000() <span style="color: rgb(0, 0, 128); font-weight: bold;" class="">throws </span>IOException {<br class=""> System.<span style="color: rgb(102, 14, 122); font-weight: bold; font-style: italic;" class="">out</span>.println(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"test.dir = " </span>+<br class=""> System.<span style="font-style: italic;" class="">getProperty</span>(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"test.dir"</span>, <span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"."</span>));<br class=""> System.<span style="color: rgb(102, 14, 122); font-weight: bold; font-style: italic;" class="">out</span>.println(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"user.dir = " </span>+<br class=""> System.<span style="font-style: italic;" class="">getProperty</span>(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"user.dir"</span>, <span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"."</span>));<br class=""> System.<span style="color: rgb(102, 14, 122); font-weight: bold; font-style: italic;" class="">out</span>.println(<br class=""> Paths.<span style="font-style: italic;" class="">get</span>(System.<span style="font-style: italic;" class="">getProperty</span>(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"test.dir"</span>, <span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"."</span>), <span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"basic.jar"</span>).toAbsolutePath()<br class=""> );<br class=""> }</font></pre><div class=""><br class=""></div></div><div>-----------------</div><div><br class=""></div><div>Results in:</div><div>--------------------</div><div><div>test.dir = .</div><div>user.dir = /Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch</div><div>/Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch/./basic.jar</div><div><br class=""></div><div>Please see <a href="http://openjdk.java.net/jtreg/tag-spec.html" class="">http://openjdk.java.net/jtreg/tag-spec.html</a> for the system properties. I do not see test.dir there.</div><div>—————————</div><div><br class=""></div><div>I would just do:</div><div><br class=""></div><div>—————————</div><div><pre style="background-color: rgb(255, 255, 255);" class=""><font face="Helvetica" class="">Path foo = Path.<span style="font-style: italic;" class="">of</span>(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"test.zip"</span>);<br class="">System.<span style="color: rgb(102, 14, 122); font-weight: bold; font-style: italic;" class="">out</span>.println(<span style="color: rgb(0, 128, 0); font-weight: bold;" class="">"test.zip path=" </span>+ foo.toAbsolutePath());</font></pre><div class=""><br class=""></div></div><div>--------------------------</div></div><div class=""><br class="webkit-block-placeholder"></div><div class="">which results in the output: </div><div class=""><div class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2;" class=""><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "></span></span></a><a href="http://oracle.com/us/design/oracle-email-sig-198324.gif" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; border-spacing: 0px; -webkit-text-decorations-in-effect: none; "><span class="Apple-style-span" style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; border-spacing: 0px; -webkit-text-decorations-in-effect: none; "></span></span></span></a><div style="font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; text-align: -webkit-auto;" class=""><font color="#0069d9" size="3" class=""><u class="">test.zip path=/Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch/test.zip</u></font></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037</span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><font color="#FF0000" style="color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Oracle</font><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> Java Engineering </span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">1 Network Drive </span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><span style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Burlington, MA 01803</span><br style="color: rgb(102, 102, 102); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; " class=""><a href="mailto:Lance.Andersen@oracle.com" style="color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Lance.Andersen@oracle.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><br class="Apple-interchange-newline">
</span></div>
</div><br class=""></body></html>