Class TripleObjectWriter

  • All Implemented Interfaces:
    org.metafacture.framework.LifeCycle, org.metafacture.framework.ObjectReceiver<org.metafacture.framework.objects.Triple>, org.metafacture.framework.Receiver

    @Description("Writes the object value of the triple into a file. The filename is constructed from subject and predicate. Please note: This module does not check if the filename constructed from subject and predicate stays within `baseDir`. THIS MODULE SHOULD NOT BE USED IN ENVIRONMENTS IN WHICH THE VALUES OF SUBJECT AND PREDICATE A PROVIDED BY AN UNTRUSTED SOURCE!")
    @In(org.metafacture.framework.objects.Triple.class)
    @Out(java.lang.Void.class)
    @FluxCommand("write-triple-objects")
    public final class TripleObjectWriter
    extends org.metafacture.framework.helpers.DefaultObjectReceiver<org.metafacture.framework.objects.Triple>
    Writes the object value of the triple into a file. The filename is constructed from subject and predicate. Please note: This module does not check if the filename constructed from subject and predicate stays within baseDir. THIS MODULE SHOULD NOT BE USED IN ENVIRONMENTS IN WHICH THE VALUES OF SUBJECT AND PREDICATE A PROVIDED BY AN UNTRUSTED SOURCE!
    • Constructor Summary

      Constructors 
      Constructor Description
      TripleObjectWriter​(java.lang.String baseDir)
      Creates an instance of TripleObjectWriter with a given directory to write to.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEncoding()
      Returns the encoding used to open the resource.
      void process​(org.metafacture.framework.objects.Triple triple)  
      void setEncoding​(java.lang.String encoding)
      Sets the encoding used to open the resource.
      void setEncoding​(java.nio.charset.Charset encoding)
      Sets the encoding used to open the resource.
      • Methods inherited from class org.metafacture.framework.helpers.DefaultLifeCycle

        closeStream, resetStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.metafacture.framework.LifeCycle

        closeStream, resetStream
    • Constructor Detail

      • TripleObjectWriter

        public TripleObjectWriter​(java.lang.String baseDir)
        Creates an instance of TripleObjectWriter with a given directory to write to.
        Parameters:
        baseDir - the path to the base directory
    • Method Detail

      • setEncoding

        public void setEncoding​(java.lang.String encoding)
        Sets the encoding used to open the resource.
        Parameters:
        encoding - new encoding
      • setEncoding

        public void setEncoding​(java.nio.charset.Charset encoding)
        Sets the encoding used to open the resource.
        Parameters:
        encoding - new encoding
      • getEncoding

        public java.lang.String getEncoding()
        Returns the encoding used to open the resource.
        Returns:
        current default setting
      • process

        public void process​(org.metafacture.framework.objects.Triple triple)
        Specified by:
        process in interface org.metafacture.framework.ObjectReceiver<org.metafacture.framework.objects.Triple>
        Overrides:
        process in class org.metafacture.framework.helpers.DefaultObjectReceiver<org.metafacture.framework.objects.Triple>