owner
owner copied to clipboard
Converting `~` to java.nio.file.Path?
Is there native Owner support to convert ~
to a Path object, similar to as for File
? See code below.
Or do I need to create my own TypeConverter for this? Or could a TypeConverter for Path
be added in a `owner-java7-extras´ module?
import java.nio.file.Path;
import org.aeonbits.owner.Config;
import org.aeonbits.owner.ConfigFactory;
public class Example {
public static void main(String[] args) {
WithPath conf = ConfigFactory.create(WithPath.class);
System.out.println(conf.getPath());
}
public interface WithPath extends Config {
@DefaultValue("~")
Path getPath();
}
}