public final class ReloadableFileAccessor<T> extends Object implements SingletonAccessor<T>
Constructor and Description |
---|
ReloadableFileAccessor(FileMarshaller<T> fileMarshaller,
String filename) |
ReloadableFileAccessor(FileMarshaller<T> marshaller,
String fileName,
URL fileUrl) |
Modifier and Type | Method and Description |
---|---|
T |
get()
Retrieves the current value.
|
String |
getFilename() |
long |
getLastModified() |
void |
set(T newValue)
Sets the new value.
|
public ReloadableFileAccessor(@Nonnull FileMarshaller<T> fileMarshaller, @Nonnull String filename)
@Nullable public final T get() throws IOException
SingletonAccessor
get
in interface SingletonAccessor<T>
IOException
- if an exception happens while retrieving the value.public final long getLastModified() throws IOException
IOException
public final void set(@Nonnull T newValue) throws IOException
SingletonAccessor
set
in interface SingletonAccessor<T>
newValue
- the new value to set.IOException
- if an exception happens while setting the value.Copyright © 2020. All Rights Reserved.