code: public static boolean isTemporaryFile(CmsResource resource) {
  
          return (resource != null)
              && ((resource.isFile()
                  && (((resource.getFlags() & CmsResource.FLAG_TEMPFILE) > 0)
                      || (CmsResource.isTemporaryFileName(resource.getName())))));
      }
docs: Returns <code>true</code> if the given resource is a temporary file.<p>
  
  A resource is considered a temporary file it is a file where the
  {@link CmsResource#FLAG_TEMPFILE} flag has been set, or if the file name (without parent folders)
  starts with the prefix char <code>'~'</code> (tilde).<p>
  
  @param resource the resource name to check
  
  @return <code>true</code> if the given resource name is a temporary file
  
  @see #getTemporaryFileName(String)
  @see CmsResource#isTemporaryFileName(String)