title: How to get the current umask value from Java?
body: <p>I am running java 7 applications on unix machines. Is there a way to get the current umask value in pure java ? </p>
  
  <p>In C I would use a combination of <code>umask</code> system calls, but I don't think I can call that in Java without resorting to JNI. Is there another approach ?</p>
  
  <p><strong>Edit:</strong> Here is a C example (from GUN libc docs):</p>
  
  <pre><code>      mode_t
        read_umask (void)
        {
          mode_t mask = umask (0);
          umask (mask);
          return mask;
        }
  </code></pre>