转载:去除文件只读隐藏属性

转载网址:http://blog.sina.com.cn/s/blog_5edcfe6a0100iogn.html

/**
  * 去除文只读隐藏属性
  * @param absolutePath  String
  */


public static void clearReadonly(String absolutePath) {
  try {


   Runtime.getRuntime().exec("cmd /c attrib " + absolutePath + " -r -a -s -h");

  System.out.println("文件: " + absolutePath + " 已去除只读属性!");


  } catch (IOException e) {
   e.printStackTrace();
  }

}

原文地址:https://www.cnblogs.com/lraa/p/3090891.html