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

Examples of uk.gov.nationalarchives.droid.core.interfaces.resource.FileSystemIdentificationRequest


        identifier.setParentId(1L);
        try {
            fileName = file.getCanonicalPath();
            RequestMetaData metaData =
                new RequestMetaData(file.length(), file.lastModified(), fileName);
            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 = "";
            for (IdentificationResult identResult : results.getResults()) {
View Full Code Here


                new RequestMetaData(file.length(), file.lastModified(), fileName);
            RequestIdentifier identifier = new RequestIdentifier(uri);
            identifier.setParentId(1L);
           
            InputStream in = null;
            IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
            try {
                in = new FileInputStream(file);
                request.open(in);
                IdentificationResultCollection results =
                    binarySignatureIdentifier.matchBinarySignatures(request);
               
                resultPrinter.print(results, request);
            } catch (FileNotFoundException fnfe) {
              log.error("error processing files", fnfe);
              throw new CommandExecutionException(fnfe);
            } catch (IOException e) {
                throw new CommandExecutionException(e);
            } finally {
                if (in != null) {
                    try {
                      request.close();
                      file=null;
                      in.close();
                       
                    } catch (IOException e) {
                        throw new CommandExecutionException(e);
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.core.interfaces.resource.FileSystemIdentificationRequest

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.