ColdFusion 10 adds a nifty little feature to the VFS (Virtual File System) - support for FTP, HTTP, and ZIP. This means you can treat remote resources and zip files as if they were simple file systems. The docs don't go into great detail on this (and instead ask you to read the Apache Commons docs instead), but I discovered a simple, but really nice, good example of this.
Because fileRead supports http, if you want to quickly grab the contents of a URL, you can use it as I've done above. All it does is save you one line of code (compared to the normal cfhttp call followed by a set to grab the file contents), but it's handy!
Archived Comments
Do you think this trick would be upward compatible in future CF versions of CF and Java? I always wonder whether a trick I use will come back to bite me in the ass a few years from now.
It's documented, so yes. :)
Pretty cool. I assume this performs a GET operation? From the Apache docs it doesn't look like it could be a versatile replacement for cfhttp.
Yep, it's a GET. Obviously it won't work if you have different needs.