Package uk.gov.nationalarchives.droid.core.interfaces

Examples of uk.gov.nationalarchives.droid.core.interfaces.IdentificationRequest.open()


        RequestMetaData metaData = new RequestMetaData(file.length(), file.lastModified(), SCANFILE);
        RequestIdentifier identifier = new RequestIdentifier(resourceUri);
        identifier.setParentId(1L);
       
        IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
        request.open(in);

        IdentificationResultCollection resultsCollection = droid.matchBinarySignatures(request);
        List<IdentificationResult> results = resultsCollection.getResults();
       
        assertEquals(EXPECTED_HITS, results.size());
View Full Code Here


        identifier.setParentId(1L);
        identifier.setParentPrefix("X");
        identifier.setAncestorId(1L);
       
        IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
        request.open(in);

        Future<IdentificationResultCollection> future = submissionGateway.submit(request);
        future.get();

        // Wait for the done() method to complete.
View Full Code Here

        RequestMetaData metaData = new RequestMetaData(file.length(), file.lastModified(), SCANFILE);
        RequestIdentifier identifier = new RequestIdentifier(resourceUri);
        identifier.setParentId(1L);
       
        IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
        request.open(in);

        IdentificationResultCollection resultsCollection = droid.matchBinarySignatures(request);
        List<IdentificationResult> results = resultsCollection.getResults();
       
        assertEquals(EXPECTED_HITS, results.size());
View Full Code Here

        RequestMetaData metaData = new RequestMetaData(file.length(), file.lastModified(), SCANFILE);
        RequestIdentifier identifier = new RequestIdentifier(resourceUri);
        identifier.setParentId(1L);
       
        IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
        request.open(in);

        IdentificationResultCollection resultsCollection = droid.matchBinarySignatures(request);
        List<IdentificationResult> results = resultsCollection.getResults();
       
        assertEquals(EXPECTED_HITS, results.size());
View Full Code Here

        RequestMetaData metaData = new RequestMetaData(file.length(), file.lastModified(), "sample.pdf");
        RequestIdentifier identifier = new RequestIdentifier(resourceUri);
        identifier.setParentId(1L);
       
        IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
        request.open(in);
//        IdentificationRequest request = ResourceWrapperFactoryImpl.newResourceWrapper(resourceUri, 1L);
       
        IdentificationResultCollection results = droid.matchBinarySignatures(request);
       
//        ArgumentCaptor<IdentificationResultCollection> resultCaptor =
View Full Code Here

        IdentificationRequest request = factory.newRequest(metaData, identifier);
        InputStream in = null;
        try {
            in = file.getInputStream(entry);
            request.open(in);
        } finally {
            if (in != null) {
                in.close();
            }
        }
View Full Code Here

     * @return a Byte reader
     * @throws IOException if the input stream could not be read
     */
    protected ByteReader newByteReader(InputStream in) throws IOException {
        IdentificationRequest request = getRequestFactory().newRequest(null, null);
        request.open(in);
        return new IdentificationRequestByteReaderAdapter(request);
    }
   
     /**
     * @param requestFactory the requestFactory to set
View Full Code Here

            identifier.setParentId(correlationId);
           
            archiveRequest = factory.newRequest(metaData, identifier);
            final InputStream gzin = new GZIPInputStream(in);
            try {
                archiveRequest.open(gzin);
            } finally {
                if (gzin != null) {
                    gzin.close();               
                }
            }
View Full Code Here

       
        RequestIdentifier identifier = new RequestIdentifier(ArchiveFileUtils.toZipUri(parentName, entry.getName()));
        identifier.setAncestorId(originatorNodeId);
        identifier.setParentResourceId(correlationId);
        IdentificationRequest request = factory.newRequest(metaData, identifier);
        request.open(in);
        droidCore.submit(request);
    }
   
    /**
     * @param factory the factory to set
View Full Code Here

        RequestIdentifier identifier =
            new RequestIdentifier(ArchiveFileUtils.toTarUri(parentName, entry.getName()));
        identifier.setAncestorId(originatorNodeId);
        identifier.setParentResourceId(correlationId);
        IdentificationRequest request = factory.newRequest(metaData, identifier);
        request.open(in);
        droidCore.submit(request);
    }
   
    /**
     * @param parentName
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.