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

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


            long correlationId = request.getIdentifier().getNodeId();
            final URI uri = ArchiveFileUtils.toGZipUri(parent);
   
            String path = uri.getSchemeSpecificPart();
            String fileName = FilenameUtils.getName(path);
            final RequestMetaData metaData = new RequestMetaData(null, null, fileName);
           
            RequestIdentifier identifier = new RequestIdentifier(uri);
            identifier.setAncestorId(request.getIdentifier().getAncestorId());
            identifier.setParentId(correlationId);
           
View Full Code Here


        IdentificationResultImpl result = new IdentificationResultImpl();
       
        long size = entry.getSize();
        long time = entry.getTime();
       
        RequestMetaData metaData = new RequestMetaData(
                size != -1 ? size : null,
                time != -1 ? time : null,
                entryName);
       
        RequestIdentifier identifier = new RequestIdentifier(
View Full Code Here

        throws IOException {
       
        long size = entry.getSize();
        long time = entry.getTime();
       
        RequestMetaData metaData = new RequestMetaData(
                size != -1 ? size : null,
                time != -1 ? time : null,
                entryName);
       
        RequestIdentifier identifier = new RequestIdentifier(ArchiveFileUtils.toZipUri(parentName, entry.getName()));
View Full Code Here

    final void submit(TarArchiveEntry entry, String entryName, URI parentName,
            ArchiveInputStream in, ResourceId correlationId, long originatorNodeId) throws IOException {
        long size = entry.getSize();
        Date time = entry.getModTime();

        RequestMetaData metaData = new RequestMetaData(
                size == -1 ? null : size,
                time == null ? null : time.getTime(),
                entryName);
       
        RequestIdentifier identifier =
View Full Code Here

       
        long size = entry.getSize();
        Date date = entry.getModTime();
        long time = date == null ? -1 : date.getTime();
       
        RequestMetaData metaData = new RequestMetaData(
                size != -1 ? size : null,
                time != -1 ? time : null,
                entryName);
       
        RequestIdentifier identifier = new RequestIdentifier(
View Full Code Here

     *            an optional node ID for the request.
     */
    public void onEvent(File file, ResourceId parentId, ResourceId nodeId) {

        URI uri = file.toURI();
        RequestMetaData metaData = new RequestMetaData(file.length(), file
                .lastModified(), file.getName());

        RequestIdentifier identifier = new RequestIdentifier(uri);
        identifier.setParentResourceId(parentId);
        identifier.setResourceId(nodeId);
View Full Code Here

     */
    public ResourceId onEvent(File dir, ResourceId parentId, int depth, boolean restricted) {
        IdentificationResultImpl result = new IdentificationResultImpl();
        result.setMethod(IdentificationMethod.NULL);
       
        RequestMetaData metaData = new RequestMetaData(
                dir.length(),
                dir.lastModified(),
                depth == 0 ? dir.getAbsolutePath() : dir.getName());
       
        RequestIdentifier identifier = new RequestIdentifier(dir.toURI());
View Full Code Here

   
    @Test
    public void testNewZipRequest() throws Exception {

        URI zipUri = new URI("zip:file:/foo.bar!/fu.bah");
        RequestMetaData metaData = new RequestMetaData(12345L, 67890L, "fu.bah");
        InputStream in = mock(InputStream.class);
        when(in.read()).thenReturn(-1);
        when(in.read(any(byte[].class))).thenReturn(-1);
        when(in.read(any(byte[].class), anyInt(), anyInt())).thenReturn(-1);
        when(in.skip(anyLong())).thenReturn(-1L);
View Full Code Here

        ooXmlIdentifier.addContainerSignature(sig);
        ooXmlIdentifier.setFormats(formats);
       
        InputStream word97Stream = getClass().getClassLoader().getResourceAsStream("word_ooxml.docx");
       
        RequestMetaData metaData = mock(RequestMetaData.class);
        IdentificationRequest request = mock(IdentificationRequest.class);
        when(request.getSourceInputStream()).thenReturn(word97Stream);
        when(request.getRequestMetaData()).thenReturn(metaData);
        RequestIdentifier requestIdentifier = mock(RequestIdentifier.class);
        when(request.getIdentifier()).thenReturn(requestIdentifier);
View Full Code Here

        ole2Identifier.addContainerSignature(sig);
        ole2Identifier.setFormats(formats);
       
        InputStream word97Stream = getClass().getClassLoader().getResourceAsStream("word97.doc");
       
        RequestMetaData metaData = mock(RequestMetaData.class);
        IdentificationRequest request = mock(IdentificationRequest.class);
        when(request.getSourceInputStream()).thenReturn(word97Stream);
        when(request.getRequestMetaData()).thenReturn(metaData);
        RequestIdentifier requestIdentifier = mock(RequestIdentifier.class);
        when(request.getIdentifier()).thenReturn(requestIdentifier);
View Full Code Here

TOP

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

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.