Class MetadataFileWriterArc


  • public class MetadataFileWriterArc
    extends MetadataFileWriter
    MetadataFileWriter that writes to ARC files.
    • Constructor Detail

      • MetadataFileWriterArc

        public MetadataFileWriterArc()
    • Method Detail

      • createWriter

        public static MetadataFileWriter createWriter​(File metadataARCFile)
        Create a MetadataFileWriter for ARC output.
        Parameters:
        metadataARCFile - The metadata ARC File
        Returns:
        MetadataFileWriter for writing metadata files in ARC
      • open

        protected void open()
      • writeFileTo

        public void writeFileTo​(File file,
                                String uri,
                                String mime)
        Description copied from class: MetadataFileWriter
        Write the given file to the metadata file.
        Specified by:
        writeFileTo in class MetadataFileWriter
        Parameters:
        file - A given file with metadata to write to the metadata archive file.
        uri - The uri associated with the piece of metadata
        mime - The mimetype associated with the piece of metadata
      • writeTo

        public boolean writeTo​(File fileToArchive,
                               String URL,
                               String mimetype)
        Writes a File to an ArcWriter, if available, otherwise logs the failure to the class-logger.
        Specified by:
        writeTo in class MetadataFileWriter
        Parameters:
        fileToArchive - the File to archive
        URL - the URL with which it is stored in the arcfile
        mimetype - The mimetype of the File-contents
        Returns:
        true, if file exists, and is written to the arcfile.
      • write

        public void write​(String uri,
                          String contentType,
                          String hostIP,
                          long fetchBeginTimeStamp,
                          byte[] payload)
                   throws IOException
        Description copied from class: MetadataFileWriter
        Write a record to the archive file.
        Specified by:
        write in class MetadataFileWriter
        Parameters:
        uri - record URI
        contentType - content-type of record
        hostIP - resource ip-address
        fetchBeginTimeStamp - record datetime
        payload - A byte array containing the payload
        Throws:
        IOException
        See Also:
        ARCWriter.write(String uri, String contentType, String hostIP, long fetchBeginTimeStamp, long recordLength, InputStream in)