|
43 | 43 | * @see DataHandleService |
44 | 44 | * @see Location |
45 | 45 | */ |
46 | | -public interface IOService extends HandlerService<String, IOPlugin<?>>, |
| 46 | +public interface IOService extends HandlerService<Location, IOPlugin<?>>, |
47 | 47 | SciJavaService |
48 | 48 | { |
49 | 49 |
|
50 | 50 | /** |
51 | 51 | * Gets the most appropriate {@link IOPlugin} for opening data from the given |
52 | | - * source. |
| 52 | + * location. |
53 | 53 | */ |
54 | | - IOPlugin<?> getOpener(String source); |
| 54 | + IOPlugin<?> getOpener(Location source); |
55 | 55 |
|
56 | 56 | /** |
57 | 57 | * Gets the most appropriate {@link IOPlugin} for saving data to the given |
58 | | - * destination. |
| 58 | + * location. |
59 | 59 | */ |
60 | | - <D> IOPlugin<D> getSaver(D data, String destination); |
| 60 | + <D> IOPlugin<D> getSaver(D data, Location destination); |
61 | 61 |
|
62 | 62 | /** |
63 | | - * Loads data from the given source. For extensibility, the nature of the |
64 | | - * source is left intentionally general, but two common examples include file |
65 | | - * paths and URLs. |
| 63 | + * Loads data from the given location. |
66 | 64 | * <p> |
67 | 65 | * The opener to use is automatically determined based on available |
68 | | - * {@link IOPlugin}s; see {@link #getOpener(String)}. |
| 66 | + * {@link IOPlugin}s; see {@link #getOpener(Location)}. |
69 | 67 | * </p> |
70 | 68 | * |
71 | | - * @param source The source (e.g., file path) from which to data should be |
72 | | - * loaded. |
| 69 | + * @param source The location from which to data should be loaded. |
73 | 70 | * @return An object representing the loaded data, or null if the source is |
74 | 71 | * not supported. |
75 | 72 | * @throws IOException if something goes wrong loading the data. |
76 | 73 | */ |
77 | | - Object open(String source) throws IOException; |
| 74 | + Object open(Location source) throws IOException; |
78 | 75 |
|
79 | 76 | /** |
80 | | - * Saves data to the given destination. The nature of the destination is left |
81 | | - * intentionally general, but the most common example is a file path. |
| 77 | + * Saves data to the given location. |
82 | 78 | * <p> |
83 | 79 | * The saver to use is automatically determined based on available |
84 | | - * {@link IOPlugin}s; see {@link #getSaver(Object, String)}. |
| 80 | + * {@link IOPlugin}s; see {@link #getSaver(Object, Location)}. |
85 | 81 | * </p> |
86 | 82 | * |
87 | 83 | * @param data The data to be saved to the destination. |
88 | | - * @param destination The destination (e.g., file path) to which data should |
89 | | - * be saved. |
| 84 | + * @param destination The destination location to which data should be saved. |
90 | 85 | * @throws IOException if something goes wrong saving the data. |
91 | 86 | */ |
92 | | - void save(Object data, String destination) throws IOException; |
| 87 | + void save(Object data, Location destination) throws IOException; |
93 | 88 |
|
94 | 89 | } |
0 commit comments