Package org.opengrok.indexer.util
Class TandemPath
java.lang.Object
org.opengrok.indexer.util.TandemPath
Represents a utility class for creating a path to operate in tandem with
 an original path by adding a new file extension but limiting the length
 of the filename component of the new path to 255 UTF-8 encoded bytes if
 necessary by truncating and packing in a Base64-encoded SHA-256 hash of the
 original file name component.
- 
Method Summary
Modifier and TypeMethodDescriptionstatic StringAppends an ASCII extension to the specifiedfilePath, truncating and packing in a SHA-256 hash if the UTF-8 encoding of the filename component of the path would exceed 254 bytes and arriving at a final size of 255 bytes in that special case. 
- 
Method Details
- 
join
Appends an ASCII extension to the specifiedfilePath, truncating and packing in a SHA-256 hash if the UTF-8 encoding of the filename component of the path would exceed 254 bytes and arriving at a final size of 255 bytes in that special case.- Parameters:
 filePath- a defined instanceasciiExtension- a defined instance that is expected to be only ASCII so that its UTF-8 form is the same length- Returns:
 - a transformed path whose filename component's UTF-8 encoding is not more than 255 bytes.
 - Throws:
 IllegalArgumentException-asciiExtensionis too long to allow packing a SHA-256 hash in the transformation.
 
 -