◐ Shell
reader mode source ↗
Skip to content
Closed
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
27 changes: 23 additions & 4 deletions src/main/java/org/scijava/io/IOService.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ default <D> IOPlugin<D> getSaver(D data, Location destination) {
return null;
}

/**
* Loads data from the given source. For extensibility, the nature of the
* source is left intentionally general, but two common examples include file
Expand All @@ -95,11 +104,16 @@ default <D> IOPlugin<D> getSaver(D data, Location destination) {
* The opener to use is automatically determined based on available
* {@link IOPlugin}s; see {@link #getOpener(String)}.
* </p>
*
* @param source The source (e.g., file path) from which to data should be
* loaded.
* @return An object representing the loaded data, or null if the source is
* not supported.
* @throws IOException if something goes wrong loading the data.
*/
Object open(String source) throws IOException;
Expand All @@ -110,10 +124,15 @@ default <D> IOPlugin<D> getSaver(D data, Location destination) {
* The opener to use is automatically determined based on available
* {@link IOPlugin}s; see {@link #getOpener(Location)}.
* </p>
*
* @param source The location from which to data should be loaded.
* @return An object representing the loaded data, or null if the source is
* not supported.
* @throws IOException if something goes wrong loading the data.
*/
default Object open(Location source) throws IOException {
Expand Down
Toggle all file notes Toggle all file annotations