de.smartics.properties.config.transfer.filesystem
Class FileSystemPropertySink

Package class diagram package FileSystemPropertySink
java.lang.Object
  extended by de.smartics.properties.config.transfer.filesystem.FileSystemPropertySink
All Implemented Interfaces:
PropertySink

public final class FileSystemPropertySink
     
     
extends Object
implements PropertySink

Writes properties to a folder.


Constructor Summary
FileSystemPropertySink(File targetFolder)
          Convenience constructor to create native properties files.
FileSystemPropertySink(File targetFolder, PropertiesFormat outputFormat)
          Default constructor.
 
Method Summary
 void clear()
          Removes all information from the sink.
 void close()
          Closes the sink.
 void write(Iterable<PropertyProvider> providers)
          Writes the property definitions provided by the given providers.
 void write(PropertyProvider provider)
          Writes the property definitions provided by the given provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemPropertySink

public FileSystemPropertySink(File targetFolder)
Convenience constructor to create native properties files.

Parameters:
targetFolder - the name of the folder the properties definitions are written to.

FileSystemPropertySink

public FileSystemPropertySink(File targetFolder,
                              PropertiesFormat outputFormat)
                       throws NullPointerException
Default constructor.

Parameters:
targetFolder - the name of the folder the properties definitions are written to.
outputFormat - the format the property definition files will be written to.
Throws:
NullPointerException - if targetFolder or outputFormat is null.
Method Detail

clear

public void clear()
           throws TransferException
Description copied from interface: PropertySink
Removes all information from the sink.

Specified by:
clear in interface PropertySink
Throws:
TransferException - on any problem clearing the sink.

write

public void write(PropertyProvider provider)
           throws TransferException
Description copied from interface: PropertySink
Writes the property definitions provided by the given provider.

It is assumed that the writing is transactional. If it is not, the implementation should document that it isn't.

Specified by:
write in interface PropertySink
Parameters:
provider - the provider of property definitions.
Throws:
TransferException - on any problem writing the definitions to this sink.

write

public void write(Iterable<PropertyProvider> providers)
           throws TransferException
Description copied from interface: PropertySink
Writes the property definitions provided by the given providers.

It is assumed that the writing is transactional. If it is not, the implementation should document that it isn't.

Specified by:
write in interface PropertySink
Parameters:
providers - the list of providers to add their property definitions.
Throws:
TransferException - on any problem writing property definitions to this sink.

close

public void close()
           throws TransferException
Closes the sink. No more writing to the sink will be allowed after the sink is closed.

This is a no-op.

Specified by:
close in interface PropertySink
Throws:
TransferException - on any problem closing the sink.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.