Package uk.gov.nationalarchives.pronom

Examples of uk.gov.nationalarchives.pronom.SignatureFileType$InternalSignatureCollection


     * @param entryName the name of the container file entry
     */
    public void matchFileEntry(String entryName) {
        if (unmatchedFiles.contains(entryName)) {
            //String textSig = signature.getFiles().get(entryName).getTextSignature();
            InternalSignatureCollection binSigs = signature.getFiles().get(entryName).getCompiledBinarySignatures();
            //if (textSig == null && binSig == null) {
            if (binSigs == null) {
                unmatchedFiles.remove(entryName);
            }
        }
View Full Code Here


     * @return true if this file is subject to a text signature; false otherwise
     */
    public boolean needsBinaryMatch(String entryName) {
        boolean needsMatch = false;
        if (unmatchedFiles.contains(entryName)) {
            InternalSignatureCollection binarySigs = signature.getFiles().get(entryName).getCompiledBinarySignatures();
            needsMatch = binarySigs != null;
        }
        return needsMatch;
    }
View Full Code Here

     */
    public void matchBinaryContent(String entryName, ByteReader content) {
        boolean matched = true;
        if (unmatchedFiles.contains(entryName)) {
            Map<String, ContainerFile> sigFiles = signature.getFiles();
            InternalSignatureCollection binSigs = sigFiles.get(entryName).getCompiledBinarySignatures();
            if (binSigs != null) {
                matched = binSigs.getMatchingSignatures(content, maxBytesToScan).size() > 0;
            }
            if (matched) {
                unmatchedFiles.remove(entryName);
            }
        }
View Full Code Here

        serializer.setOutputCharStream(writer);

        serializer.serialize(internalSigXml);
        xmlReader.parse(new InputSource(new StringReader(writer.getBuffer().toString())));
       
        InternalSignatureCollection sigs = (InternalSignatureCollection) mb.getModel();
        assertEquals(1, sigs.getInternalSignatures().size());
        InternalSignature sig = sigs.getInternalSignatures().get(0);
        assertEquals(2, sig.getByteSequences().size());
    }
View Full Code Here

    // Write it out raw:
    File raw = new File("droid-signature-raw_"+sigFile.getFFSignatureFile().getVersion()+".xml");
    writeSigFileToOutputStream( sigFile, new FileOutputStream(raw) );
   
    // Read it back:
    SignatureFileType s2 = readSigFileType( new File(filename) );
    System.out.println("Read back sigfile: "+s2.getVersion());
   
    System.out.println(downloadPronomRecordForPUID("fmt/1").substring(0, 500));
   
    // This downloads all the valid PRONOM record files.
    //downloadAllPronomFormatRecords();
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.pronom.SignatureFileType$InternalSignatureCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.