code: static long getFileLength(final File fileToCheck)
  	  {
  	    try {
  	      Long size = getInstance().doPrivileged(
  	        new PrivilegedAction<Long>() {
  	          public Long run() {
  	            return Long.valueOf(fileToCheck.length());
  	          }
  	        }
  	      );
  	      return size.longValue();
  	    }
  	    catch (SecurityException se) {
  			// TODO: Add logging here but be careful since this code is used in logging logic itself
  			//       and may result in an indefinite loop.
  	    	return 0L;
  	    }
  	  }
docs: Using privileged java security determine the length of an existing file.
  <p>
  @param fileToCheck a non-null <code>File</code> object whose abstract pathname
  corresponds to the physical file to check. The caller must guarantee that passed
  object is non null and that the physical file exists.
  @return the length, in bytes of the file. 0 is returned if the file does not exist.
  If a SecurityException is encountered, the exception is logged, absorbed and 0 is
  returned.