tag:blogger.com,1999:blog-8712770457197348465.post6126289548215421295..comments2024-03-28T18:10:34.431-07:00Comments on Javarevisited: How to check if a File is hidden in Java? Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8712770457197348465.post-64746890319164548792020-04-11T22:39:49.244-07:002020-04-11T22:39:49.244-07:00Thanks Shramik for this useful information and add...Thanks Shramik for this useful information and adding value to the post.javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-68667726522150609322020-04-11T07:15:04.983-07:002020-04-11T07:15:04.983-07:00We can set hidden attribute for DOS based OS (Wind...We can set hidden attribute for DOS based OS (Windows) as below using NIO2 API<br /><br />Path path = Paths.get("c:\sample");<br />Files.createFile(path);<br />Files.setAttribute(path, "dos:hidden", true);<br /><br />or<br /><br />DosFileAttributeView dosFileAttrView = Files.getFileAttributeView(path, DosFileAttributeView.class);<br />dosFileAttrView.setHidden(true);<br /><br Shramikhttps://www.blogger.com/profile/04253003930687345274noreply@blogger.com