@Test void testLoadNonexistantPath(final @TempDir Path tempDir) throws IOException { final Path tempPath = tempDir.resolve("text5.txt").getRoot().resolve("does-not-exist-dont-edit-testdir"); final TestConfigurationLoader loader = TestConfigurationLoader.builder().setPath(tempPath).build(); loader.load(); }
@Override public N load(ConfigurationOptions options) throws IOException { if (this.source == null) { throw new IOException("No source present to read from!"); } try (BufferedReader reader = this.source.call()) { if (this.headerMode == HeaderMode.PRESERVE || this.headerMode == HeaderMode.NONE) { final @Nullable String comment = CommentHandlers.extractComment(reader, this.commentHandlers); if (comment != null && comment.length() > 0) { options = options.withHeader(comment); } } final N node = createNode(options); loadInternal(node, reader); return node; } catch (final FileNotFoundException | NoSuchFileException e) { return createNode(options); } catch (final IOException e) { throw e; } catch (final Exception e) { throw new IOException(e); } }
AbstractConfigurationLoader implements ConfigurationLoader<N> { @Override public N load(ConfigurationOptions options) throws IOException { if (this.source == null) { throw new IOException("No source present to read from!"); } try (BufferedReader reader = this.source.call()) { if (this.headerMode == HeaderMode.PRESERVE || this.headerMode == HeaderMode.NONE) { final @Nullable String comment = CommentHandlers.extractComment(reader, this.commentHandlers); if (comment != null && comment.length() > 0) { options = options.withHeader(comment); } } final N node = createNode(options); loadInternal(node, reader); return node; } catch (final FileNotFoundException | NoSuchFileException e) { return createNode(options); } catch (final IOException e) { throw e; } catch (final Exception e) { throw new IOException(e); } } }
AbstractConfigurationLoader implements ConfigurationLoader<N> { @Override public N load(ConfigurationOptions options) throws IOException { if (this.source == null) { throw new IOException("No source present to read from!"); } try (BufferedReader reader = this.source.call()) { if (this.headerMode == HeaderMode.PRESERVE || this.headerMode == HeaderMode.NONE) { final @Nullable String comment = CommentHandlers.extractComment(reader, this.commentHandlers); if (comment != null && comment.length() > 0) { options = options.withHeader(comment); } } final N node = createNode(options); loadInternal(node, reader); return node; } catch (final FileNotFoundException | NoSuchFileException e) { return createNode(options); } catch (final IOException e) { throw e; } catch (final Exception e) { throw new IOException(e); } } protected  AbstractConfigurationLoader(final Builder<?, ?> builder, final CommentHandler[] commentHandlers); }
AbstractConfigurationLoader implements ConfigurationLoader<N> { @Override public N load(ConfigurationOptions options) throws IOException { if (this.source == null) { throw new IOException("No source present to read from!"); } try (BufferedReader reader = this.source.call()) { if (this.headerMode == HeaderMode.PRESERVE || this.headerMode == HeaderMode.NONE) { final @Nullable String comment = CommentHandlers.extractComment(reader, this.commentHandlers); if (comment != null && comment.length() > 0) { options = options.withHeader(comment); } } final N node = createNode(options); loadInternal(node, reader); return node; } catch (final FileNotFoundException | NoSuchFileException e) { return createNode(options); } catch (final IOException e) { throw e; } catch (final Exception e) { throw new IOException(e); } } protected  AbstractConfigurationLoader(final Builder<?, ?> builder, final CommentHandler[] commentHandlers); CommentHandler getDefaultCommentHandler(); @Override ConfigurationReference<N> loadToReference(); @Override N load(ConfigurationOptions options); @Override void save(final ConfigurationNode node); @Override ConfigurationOptions defaultOptions(); @Override final boolean canLoad(); @Override final boolean canSave(); }
AbstractConfigurationLoader implements ConfigurationLoader<N> { @Override public N load(ConfigurationOptions options) throws IOException { if (this.source == null) { throw new IOException("No source present to read from!"); } try (BufferedReader reader = this.source.call()) { if (this.headerMode == HeaderMode.PRESERVE || this.headerMode == HeaderMode.NONE) { final @Nullable String comment = CommentHandlers.extractComment(reader, this.commentHandlers); if (comment != null && comment.length() > 0) { options = options.withHeader(comment); } } final N node = createNode(options); loadInternal(node, reader); return node; } catch (final FileNotFoundException | NoSuchFileException e) { return createNode(options); } catch (final IOException e) { throw e; } catch (final Exception e) { throw new IOException(e); } } protected  AbstractConfigurationLoader(final Builder<?, ?> builder, final CommentHandler[] commentHandlers); CommentHandler getDefaultCommentHandler(); @Override ConfigurationReference<N> loadToReference(); @Override N load(ConfigurationOptions options); @Override void save(final ConfigurationNode node); @Override ConfigurationOptions defaultOptions(); @Override final boolean canLoad(); @Override final boolean canSave(); static final String CONFIGURATE_LINE_SEPARATOR; static final Pattern CONFIGURATE_LINE_PATTERN; }