code: @Override
     public boolean delete()
     {
        String path = PrivilegedFileHelper.getAbsolutePath(this);
        WeakReference<SwapFile> currentValue = CURRENT_SWAP_FILES.get(path);
        if (currentValue == null || (currentValue.get() == this || currentValue.get() == null))
        {
           CURRENT_SWAP_FILES.remove(path, currentValue);
           synchronized(this)
           {
              users.clear();
              final SpoolFile sf = this;
  
              PrivilegedAction<Boolean> action = new PrivilegedAction<Boolean>()
              {
                 public Boolean run()
                 {
                    if (sf.exists())
                    {
                       if (SwapFile.super.delete())
                       {
                          return true;
                       }
                       else if (swapCleaner != null)
                       {
                          swapCleaner.addFile(SwapFile.super.getAbsoluteFile());
                       }
                       if (LOG.isDebugEnabled())
                       {
                          LOG.debug("Could not remove swap file on finalize : "
                             + PrivilegedFileHelper.getAbsolutePath(SwapFile.super.getAbsoluteFile()));
                       }
                       return false;
                    }
                    return true;
                 }
              };
              return SecurityHelper.doPrivilegedAction(action);
           }
        }
        return false;
     }
docs: {@inheritDoc}