mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
simplify getting URL for Content types
This commit is contained in:
parent
828ec0252d
commit
ce695db98b
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user