Search in sources :

Example 1 with DefaultFileSystemLocationFingerprint

use of org.gradle.internal.fingerprint.impl.DefaultFileSystemLocationFingerprint in project gradle by gradle.

the class FingerprintMapSerializer method readFingerprint.

private FileSystemLocationFingerprint readFingerprint(Decoder decoder) throws IOException {
    FileType fileType = readFileType(decoder);
    HashCode contentHash = readContentHash(fileType, decoder);
    byte fingerprintKind = decoder.readByte();
    switch(fingerprintKind) {
        case DEFAULT_NORMALIZATION:
            String normalizedPath = decoder.readString();
            return new DefaultFileSystemLocationFingerprint(stringInterner.intern(normalizedPath), fileType, contentHash);
        case IGNORED_PATH_NORMALIZATION:
            return IgnoredPathFileSystemLocationFingerprint.create(fileType, contentHash);
        default:
            throw new RuntimeException("Unable to read serialized file fingerprint. Unrecognized value found in the data stream.");
    }
}
Also used : HashCode(org.gradle.internal.hash.HashCode) FileType(org.gradle.internal.file.FileType) DefaultFileSystemLocationFingerprint(org.gradle.internal.fingerprint.impl.DefaultFileSystemLocationFingerprint)

Aggregations

FileType (org.gradle.internal.file.FileType)1 DefaultFileSystemLocationFingerprint (org.gradle.internal.fingerprint.impl.DefaultFileSystemLocationFingerprint)1 HashCode (org.gradle.internal.hash.HashCode)1