Set And Get Attribute --- DOS
2013-12-30 15:38
253 查看
定义路径
设置属性值
获取属性值
DOS属性可以用下面的名称来获得:
Path path = Paths.get("F:/cn/icer/ws/client/Business.java");
设置属性值
//setting the hidden attribute to true try { Files.setAttribute(path, "dos:hidden", true, LinkOption.NOFOLLOW_LINKS); } catch (Exception e) { e.printStackTrace(); }
获取属性值
//getting the hidden attribute try { boolean hidden = (boolean) Files.getAttribute(path, "dos:hidden", LinkOption.NOFOLLOW_LINKS); System.out.println("Is hidden ? " + hidden); } catch (Exception e) { e.printStackTrace(); }
DOS属性可以用下面的名称来获得:
1) hidden 2) readonly 3) system 4) archive
相关文章推荐
- setAttribute and getAttribute的用法 以及阻止<a>的href的默认属性
- Get and Set Attribute Values with Properties
- Solidworks对图纸属性的获得与设置Get and Set Sheet Properties
- C# get and set
- request.getParameter/setAttribute/getAttribute
- request.getParameter()与request.setAttribute()的区别
- request.setAttribute()、session.setAttribute()和request.getParameter()的联系与区别
- WPF1: Set and Get value for a control in a form which run in another thread
- request.setAttribute()、session.setAttribute()和request.getParameter()的联系与区别
- request.setAttribute()、session.setAttribute()和request.getParameter()的联系与区别
- java 代码自动生成getAndset
- request.setAttribute()和request.getSession().setAttribute()区别
- request.getAttribute( "result");和request.setAttribute("result",username);
- NODE GET AND SET
- System.setProperty and System.getProperty
- request.setAttribute()、session.setAttribute()和request.getParameter()、request.getAttribute()的联系与区别
- request.getAttribute()与request.setAttribute()
- PHP __get()函数 and __set()函数
- session.getSession.setAttribute()和session.setAttribute()的再认识;
- request.getParameter()与request.setAttribute()的区别