CHEF-4422 Truncate cache paths for remote files

Both Windows and Unix systems place limits on the path lengths of files in the local file system that are much lower than the limits for a uri used for the http protocol. Because of this, the CacheControlData class's usage of the Chef FileCache on the local file system when storing data about files referenced by the remote_file resource, would throw exceptions for sufficiently long URI's. This occurred because the local file name that CacheControlData specified to FileCache contained an interpolated version of the remote_file's uri that was at least as long as the uri., When FileCache tried to access such files, the relevant system calls would throw an exception. In the case of Windows, this occurred when the path specified to FileCache was greater than MAX_PATH = 260 characters, and the limit was somewhat more generous on systems such as FreeBSD but still there.

This regression occurred in Chef 11.6 because usage of FileCache was added to remote_file code paths in Chef 11.6.

The fix was simple to truncate the variable part of the file name that is based on the URI -- the other parts of the file name include an MD5 hash represented in hexadecimal, so overall the path as a fixed maximum of 102 after truncating the uri to 64 characters. The uri representation in the name exists to make the local files human-readable for debugging or other forensic purposes -- it is not strictly necessary and the hash was always required to increase uniqueness. The content of the file contains a file checksum and relatively high resolution time stamps anyway, so ultimately a cache collision is no more likely with this change than earlier.