|
|
@@ -17,11 +17,10 @@ import java.net.URI;
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.nio.file.Path;
|
|
|
import java.time.Instant;
|
|
|
-import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
import net.ranides.assira.collection.query.CQuery;
|
|
|
+import net.ranides.assira.io.IOStreams;
|
|
|
import net.ranides.assira.text.IOStrings;
|
|
|
-import net.ranides.assira.text.StringUtils;
|
|
|
|
|
|
/**
|
|
|
* This is abstraction over URL, File and Path objects.
|
|
|
@@ -163,9 +162,6 @@ public interface URIHandle extends Closeable {
|
|
|
*/
|
|
|
Instant time(URITime ut) throws IOException;
|
|
|
|
|
|
- // @todo #86
|
|
|
- // Map<URITime, Instant> time() throws IOException;
|
|
|
-
|
|
|
/**
|
|
|
* Returns size of this resource, in bytes.
|
|
|
*
|
|
|
@@ -307,7 +303,7 @@ public interface URIHandle extends Closeable {
|
|
|
* @return string
|
|
|
* @throws IOException on error
|
|
|
*/
|
|
|
- default String content() throws IOException {
|
|
|
+ default String text() throws IOException {
|
|
|
return IOStrings.read(reader());
|
|
|
}
|
|
|
|
|
|
@@ -322,10 +318,14 @@ public interface URIHandle extends Closeable {
|
|
|
* @return string
|
|
|
* @throws IOException on error
|
|
|
*/
|
|
|
- default String content(Charset cs) throws IOException {
|
|
|
+ default String text(Charset cs) throws IOException {
|
|
|
return IOStrings.read(reader(cs));
|
|
|
}
|
|
|
|
|
|
+ default byte[] content() throws IOException {
|
|
|
+ return IOStreams.read(istream());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Filesystem I/O operation: removes this resource.
|
|
|
*
|