Package se.digg.dgc.valueset.v1
Class FilebasedValueSetSupplier
- java.lang.Object
-
- se.digg.dgc.valueset.v1.AbstractValueSetSupplier<File>
-
- se.digg.dgc.valueset.v1.FilebasedValueSetSupplier
-
public class FilebasedValueSetSupplier extends AbstractValueSetSupplier<File>
- Author:
- Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
-
-
Constructor Summary
Constructors Constructor Description FilebasedValueSetSupplier(File resource, Duration refreshRate)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getResourceString(File resource)
Returns a string representation of the resource being handled.protected ValueSet
getValueSet(File resource)
Reads the value set from the resource.-
Methods inherited from class se.digg.dgc.valueset.v1.AbstractValueSetSupplier
get
-
-
-
-
Constructor Detail
-
FilebasedValueSetSupplier
public FilebasedValueSetSupplier(File resource, Duration refreshRate) throws IOException
Constructor.- Parameters:
resource
- the path to the file containing the JSON representation of the value setrefreshRate
- the refresh rate (how often should the file be re-read?)- Throws:
IOException
- if the file can not be read or if the JSON can not be successfully parsed
-
-
Method Detail
-
getValueSet
protected ValueSet getValueSet(File resource) throws IOException
Reads the value set from the resource.- Specified by:
getValueSet
in classAbstractValueSetSupplier<File>
- Returns:
- the value set
- Throws:
IOException
- for read errors
-
getResourceString
protected String getResourceString(File resource)
Returns a string representation of the resource being handled.- Specified by:
getResourceString
in classAbstractValueSetSupplier<File>
- Returns:
- the resource string
-
-