sdedic commented on code in PR #4654:
URL: https://github.com/apache/netbeans/pull/4654#discussion_r1069638636
##########
platform/openide.filesystems/apichanges.xml:
##########
@@ -25,6 +25,30 @@
<apidef name="filesystems">Filesystems API</apidef>
</apidefs>
<changes>
+ <change id="fileutil.copyposixperms">
+ <api name="filesystems"/>
+ <summary>FileObject copy preserves source posix
permissions.</summary>
+ <version major="9" minor="31"/>
+ <date day="12" month="1" year="2023"/>
+ <author login="lkishalmi"/>
+ <compatibility addition="yes" semantic="compatible"/>
+ <description>
+ <a
href="@TOP@/org/openide/filesystems/FileUtil.html#copyFile-org.openide.filesystems.FileObject-org.openide.filesystems.FileObject-java.lang.String-java.lang.String-">FileUtil.copyFile(...)</a>
now preserve ATTRIBUTES and POSIX permissions.
+ </description>
+ <class name="FileUtil" package="org.openide.filesystems"/>
+ </change>
+ <change id="fileutil.niofilepath">
+ <api name="filesystems"/>
+ <summary>FileUtil can convert FileObject to/from
java.nio.file.Path.</summary>
+ <version major="9" minor="30"/>
Review Comment:
9.32 (master has currently 9.31)
##########
platform/openide.filesystems/src/org/openide/filesystems/FileUtil.java:
##########
@@ -567,6 +569,7 @@ static FileObject copyFileImpl(FileObject source,
FileObject destFolder, String
}
copy(bufIn, bufOut);
+ copyPosixPerms(source, dest);
Review Comment:
Please make a mote in method's Javadoc about behaviour enhancement since
9.31(2), people can stop writing attribute preserving code, if they read
javadoc :)
##########
platform/openide.filesystems/src/org/openide/filesystems/FileUtil.java:
##########
@@ -832,10 +846,22 @@ public static File toFile(FileObject fo) {
assert assertNormalized(retVal, BaseUtilities.isMac()); // #240180
return retVal;
}
+
+ /** Finds appropriate java.nio.file.Path to FileObject if possible.
+ * If not possible then null is returned.
+ * This is the inverse operation of {@link #toFileObject}.
+ * @param fo FileObject whose corresponding Path will be looked for
+ * @return java.nio.file.Path or null if no corresponding File exists.
+ * @since 9.30
Review Comment:
9.31 if apichanges is corrected.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists