判断 随便一个文件的“只读”“隐藏”“存档”
设置 随便一个文件的“只读”“隐藏”“存档”请详细的列一下代码,谢谢

解决方案 »

  1.   

    File类下面有方法的,
    boolean canRead() 
              测试应用程序是否可以读取此抽象路径名表示的文件。 
     boolean canWrite() 
              测试应用程序是否可以修改此抽象路径名表示的文件。 
    boolean isHidden() 
              测试此抽象路径名指定的文件是否是一个隐藏文件。
      

  2.   

    没看懂!!
    你通过policy文件控制和设置文件的属性吧
      

  3.   

    RandomAccessFile类好像可以吧!找找API
      

  4.   

    public boolean isHidden()
    Tests whether the file named by this abstract pathname is a hidden file. The exact definition of hidden is system-dependent. On UNIX systems, a file is considered to be hidden if its name begins with a period character ('.'). On Win32 systems, a file is considered to be hidden if it has been ed as such in the filesystem. Returns:
    true if and only if the file denoted by this abstract pathname is hidden according to the conventions of the underlying platform 
    Throws: 
    SecurityException - If a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the file
    Since:
    1.2
      

  5.   

    为什么不看看java api doc呢?现在已经是中文的了,别再偷懒了