@Test public void testGetPath_01() { URL url = getClass().getResource("TestFile.txt"); String filePath = url.getPath().toString(); String dirPath = filePath.substring(0, filePath.lastIndexOf("/")); properties.setProperty("prop_8", dirPath); Path path = configObject.getPath("prop_8"); assertTrue(path instanceof Path); assertTrue(path.isAbsolute()); assertEquals(dirPath, path.toString()); }
public Path getPath(String property) { Path path = FileSystems.getDefault().getPath(required(property)); if (!path.toFile().exists()) { throw new InvalidValueException(fullName(property), $(property)); } return path; }
ConfigObject { public Path getPath(String property) { Path path = FileSystems.getDefault().getPath(required(property)); if (!path.toFile().exists()) { throw new InvalidValueException(fullName(property), $(property)); } return path; } }
ConfigObject { public Path getPath(String property) { Path path = FileSystems.getDefault().getPath(required(property)); if (!path.toFile().exists()) { throw new InvalidValueException(fullName(property), $(property)); } return path; } ConfigObject(File propertiesFile);  ConfigObject(InputStream is);  ConfigObject(String path);  ConfigObject(Properties props); private  ConfigObject(String section, Properties props); private  String(String property); }
ConfigObject { public Path getPath(String property) { Path path = FileSystems.getDefault().getPath(required(property)); if (!path.toFile().exists()) { throw new InvalidValueException(fullName(property), $(property)); } return path; } ConfigObject(File propertiesFile);  ConfigObject(InputStream is);  ConfigObject(String path);  ConfigObject(Properties props); private  ConfigObject(String section, Properties props); private  String(String property); static ConfigObject forResource(String resource); static boolean isTrueValue(String value); static boolean isTrueValue(String value, boolean dfault); static boolean isEnabled(String propName); static boolean isEnabled(Properties config, String propName); static boolean isEnabled(String propName, boolean dfault); static boolean isEnabled(Properties config, String propName, boolean dfault); boolean hasProperty(String property); List<String> getPropertyNames(); Properties getProperties(); String get(String property); int getInt(String property); String get(String property, String dfault); String get(String property, boolean emptyIsNull); String get(String property, String dfault, boolean emptyIsDefault); boolean isTrue(String property); boolean isTrue(String property, boolean dfault); String required(String property); @SuppressWarnings("unchecked") T required(String property, Class<T> castTo); File getFile(String property); File getDirectory(String property); Path getPath(String property); String[] getArray(String property); String[] getArray(String property, char separator); String[] requiredArray(String property); String[] requiredArray(String property, char separator); String getParentSection(); ConfigObject getSection(String prefix); boolean hasSection(String prefix); String[] getSubsections(); String[] getSubsections(String parentSection); void set(String property, String value); }
ConfigObject { public Path getPath(String property) { Path path = FileSystems.getDefault().getPath(required(property)); if (!path.toFile().exists()) { throw new InvalidValueException(fullName(property), $(property)); } return path; } ConfigObject(File propertiesFile);  ConfigObject(InputStream is);  ConfigObject(String path);  ConfigObject(Properties props); private  ConfigObject(String section, Properties props); private  String(String property); static ConfigObject forResource(String resource); static boolean isTrueValue(String value); static boolean isTrueValue(String value, boolean dfault); static boolean isEnabled(String propName); static boolean isEnabled(Properties config, String propName); static boolean isEnabled(String propName, boolean dfault); static boolean isEnabled(Properties config, String propName, boolean dfault); boolean hasProperty(String property); List<String> getPropertyNames(); Properties getProperties(); String get(String property); int getInt(String property); String get(String property, String dfault); String get(String property, boolean emptyIsNull); String get(String property, String dfault, boolean emptyIsDefault); boolean isTrue(String property); boolean isTrue(String property, boolean dfault); String required(String property); @SuppressWarnings("unchecked") T required(String property, Class<T> castTo); File getFile(String property); File getDirectory(String property); Path getPath(String property); String[] getArray(String property); String[] getArray(String property, char separator); String[] requiredArray(String property); String[] requiredArray(String property, char separator); String getParentSection(); ConfigObject getSection(String prefix); boolean hasSection(String prefix); String[] getSubsections(); String[] getSubsections(String parentSection); void set(String property, String value);  }