Some binaries are not meant to be opened by text editor at all
[original thread by amiramw]
You can customize FileResourceResolver to reject some URIs or return a too large resource.
FileResourceResolver