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

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


        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(), 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

                new RequestMetaData(file.length(), file.lastModified(), fileName);
            FileSystemIdentificationRequest request =
                new FileSystemIdentificationRequest(metaData, identifier);

            InputStream gZipStream = new FileInputStream(file);
            request.open(gZipStream);
            gZipArchiveContentIdentifier.identify(uri, request);

        } catch (IOException e) {
            throw new CommandExecutionException(e);
        }
View Full Code Here

                new RequestMetaData(file.length(), file.lastModified(), fileName);
            FileSystemIdentificationRequest request =
                new FileSystemIdentificationRequest(metaData, identifier);

            InputStream tarStream = new FileInputStream(file);
            request.open(tarStream);
            tarArchiveContentIdentifier.identify(uri, request);

        } catch (IOException e) {
            throw new CommandExecutionException(e);
        }
View Full Code Here

                new RequestMetaData(file.length(), file.lastModified(), fileName);
            FileSystemIdentificationRequest request =
                new FileSystemIdentificationRequest(metaData, identifier);

            InputStream zipStream = new FileInputStream(file);
            request.open(zipStream);
            zipArchiveContentIdentifier.identify(uri, request);
        } catch (IOException e) {
            throw new CommandExecutionException(e);
        }
    }
View Full Code Here

            FileSystemIdentificationRequest request =
                new FileSystemIdentificationRequest(metaData, identifier);
            IdentificationResultCollection results =
                new IdentificationResultCollection(request);
            InputStream ole2Stream = new FileInputStream(file);
            request.open(ole2Stream);
            results = ole2ContainerContentIdentifier.process(request.getSourceInputStream(), results);
            if (results.getResults().isEmpty()) {
                fail("OLE2 file not identified");
            }
            String fmtExpected = "";
View Full Code Here

            FileSystemIdentificationRequest request =
                new FileSystemIdentificationRequest(metaData, identifier);
            IdentificationResultCollection results =
                new IdentificationResultCollection(request);
            InputStream zipStream = new FileInputStream(file);
            request.open(zipStream);
            results = zipContainerContentIdentifier.process(request.getSourceInputStream(), results);
            if (results.getResults().isEmpty()) {
                fail("ZIP file not identified");
            }
            String fmtExpected = "";
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.