Package org.metafacture.triples
Class TripleObjectWriter
- java.lang.Object
-
- org.metafacture.framework.helpers.DefaultLifeCycle
-
- org.metafacture.framework.helpers.DefaultObjectReceiver<org.metafacture.framework.objects.Triple>
-
- org.metafacture.triples.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 withinbaseDir. 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 ofTripleObjectWriterwith a given directory to write to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEncoding()Returns the encoding used to open the resource.voidprocess(org.metafacture.framework.objects.Triple triple)voidsetEncoding(java.lang.String encoding)Sets the encoding used to open the resource.voidsetEncoding(java.nio.charset.Charset encoding)Sets the encoding used to open the resource.-
Methods inherited from class org.metafacture.framework.helpers.DefaultLifeCycle
closeStream, resetStream
-
-
-
-
Constructor Detail
-
TripleObjectWriter
public TripleObjectWriter(java.lang.String baseDir)
Creates an instance ofTripleObjectWriterwith 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:
processin interfaceorg.metafacture.framework.ObjectReceiver<org.metafacture.framework.objects.Triple>- Overrides:
processin classorg.metafacture.framework.helpers.DefaultObjectReceiver<org.metafacture.framework.objects.Triple>
-
-