Skip to content

Commit d255cdd

Browse files
committed
IOService: add default body to open(Location) and save(Object, Location)
- this restores backwards-compatibility
1 parent 7d4a580 commit d255cdd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/org/scijava/io/IOService.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ default <D> IOPlugin<D> getSaver(D data, Location destination) {
116116
* not supported.
117117
* @throws IOException if something goes wrong loading the data.
118118
*/
119-
Object open(Location source) throws IOException;
119+
default Object open(Location source) throws IOException {
120+
throw new UnsupportedOperationException();
121+
}
120122

121123
/**
122124
* Saves data to the given destination. The nature of the destination is left
@@ -144,7 +146,9 @@ default <D> IOPlugin<D> getSaver(D data, Location destination) {
144146
* @param destination The destination location to which data should be saved.
145147
* @throws IOException if something goes wrong saving the data.
146148
*/
147-
void save(Object data, Location destination) throws IOException;
149+
default void save(Object data, Location destination) throws IOException {
150+
throw new UnsupportedOperationException();
151+
}
148152

149153
// -- HandlerService methods --
150154

0 commit comments

Comments
 (0)