simplify getting URL for Content types

This commit is contained in:
Jonathan Shook 2021-09-13 09:43:32 -05:00
parent 828ec0252d
commit ce695db98b

View File

@ -1,10 +1,11 @@
package io.nosqlbench.nb.api.content;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.nio.CharBuffer;
import java.nio.file.FileSystem;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.nio.file.spi.FileSystemProvider;
@ -22,6 +23,14 @@ public interface Content<T> extends Supplier<CharSequence>, Comparable<Content<?
URI getURI();
default URL getURL() {
try {
return getURI().toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
Path asPath();
public default String asString() {