title: Java Policy file - Deny permissions to a codebase
body: <p>In the Java policy file, the <code>grant codeBase</code> syntax specifies which codebase should be granted which permissions. for example,</p>
  
  <blockquote>
    <p>grant codeBase "file:/C:/abc.jar" {
    permission
    java.security.AllPermission; };</p>
  </blockquote>
  
  <p>grants <code>AllPermission</code> to code inside abc.jar</p>
  
  <p>In a similar way, Is there a way to <code>deny</code> permissions to a specific syntax? Like this:</p>
  
  <blockquote>
    <p>deny codeBase "file:/C:/def.jar" {
    permission
    java.io.FilePermission; };</p>
  </blockquote>
  
  <p>so that the code inside <code>def.jar</code> gets every other permissions except the FilePermission?</p>
  
  <p>Is this even possible?</p>
  
  <p><em>I know this can be easily done using the <code>SecurityManager</code> class, but I just want to know if this is possible by using the policy file only.</em></p>