title: Java - mkdir() creates read-only directory
body: <p>I am creating a directory ("FileAdmin") with the following code: </p>
  
  <pre><code>public class FileAdmin {
  
      private File dir;
  
      public FileAdmin() throws IOException{
          this.dir = new File("FileAdmin");
          if(!dir.exists() &amp; !dir.mkdir()) throw new IOException();
  }
  </code></pre>
  
  <p>Main does the following:</p>
  
  <pre><code>public static void main(String[] args) {
      try{
          FileAdmin fa = new FileAdmin();
      } catch (Exception e){
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>This is not a problem; when I create a file inside the directory  (which succeeds) and try to delete it, I can't. The problem is that mkdir() creates a read-only directory, no matter what I do:</p>
  
  <p><a href="https://i.stack.imgur.com/VgC7v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VgC7v.png" alt="FileAdmin properties on Windows 10 / &quot;Solo lectura&quot; = read-only "></a></p>
  
  <p><em>Solo lectura -> read-only</em></p>
  
  <p>I have already tried <code>dir.setWritable(true);</code> but it always returns <code>false</code>. Why is this?</p>
  
  <p><strong>EDIT 1:</strong> If I create the dir, uncheck the <code>read-only</code> option in the folder's properties, once i run the code file is deleted</p>
  
  <p><strong>EDIT 2:</strong> I'm using Windows 10</p>