T - the type of Item to operate onpublic class FilesInDirectoryMultiOutputStrategy<T> extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements MultiOutputSerializationStage.OutputStrategy<T>
MultiOutputSerializationStage which generates
individual files within a directory.
The files are named by a combination of:
ItemId transformed by an optional Function,
| Modifier and Type | Class and Description |
|---|---|
private class |
FilesInDirectoryMultiOutputStrategy.FileDestination
Class implementing the returned
MultiOutputSerializationStage.Destination objects. |
| Modifier and Type | Field and Description |
|---|---|
private File |
directory
Directory into which to write files.
|
private Logger |
log
Class logger.
|
private String |
namePrefix
String to use as a prefix for file names generated by this strategy.
|
private String |
nameSuffix
String to use as a suffix for file names generated by this strategy.
|
private com.google.common.base.Function<String,String> |
nameTransformer
|
| Constructor and Description |
|---|
FilesInDirectoryMultiOutputStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doInitialize() |
MultiOutputSerializationStage.Destination |
getDestination(Item<T> item)
Gets a
MultiOutputSerializationStage.Destination to which an item should be serialized. |
File |
getDirectory()
Gets the directory in use.
|
String |
getNamePrefix()
Gets the name prefix in use.
|
String |
getNameSuffix()
Gets the name suffix in use.
|
com.google.common.base.Function<String,String> |
getNameTransformer()
Gets the name transformer in use.
|
void |
setDirectory(File dir)
Sets the directory to use.
|
void |
setNamePrefix(String prefix)
Sets the name prefix to use.
|
void |
setNameSuffix(String suffix)
Sets the name suffix to use.
|
void |
setNameTransformer(com.google.common.base.Function<String,String> transformer)
Sets the name transformer to use.
|
private final Logger log
@Nonnull private String namePrefix
@Nonnull private String nameSuffix
@NonnullAfterInit private File directory
@Nonnull public String getNamePrefix()
public void setNamePrefix(@Nonnull String prefix)
prefix - the name prefix to use@Nonnull public com.google.common.base.Function<String,String> getNameTransformer()
public void setNameTransformer(@Nonnull com.google.common.base.Function<String,String> transformer)
transformer - the name transformer to use@Nonnull public String getNameSuffix()
public void setNameSuffix(@Nonnull String suffix)
suffix - the name suffix to use@Nonnull public File getDirectory()
public void setDirectory(@Nonnull File dir)
dir - the directory to usepublic MultiOutputSerializationStage.Destination getDestination(Item<T> item) throws StageProcessingException
MultiOutputSerializationStage.OutputStrategyMultiOutputSerializationStage.Destination to which an item should be serialized.getDestination in interface MultiOutputSerializationStage.OutputStrategy<T>item - Item for which to generate a MultiOutputSerializationStage.DestinationMultiOutputSerializationStage.Destination for the itemStageProcessingException - if an output stream cannot be generated for
the Itemprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2016. All rights reserved.