Class DefaultIOService

    • Constructor Detail

      • DefaultIOService

        public DefaultIOService()
    • Method Detail

      • open

        public Object open​(String source)
                    throws IOException
        Description copied from interface: IOService
        Loads data from the given source. For extensibility, the nature of the source is left intentionally general, but two common examples include file paths and URLs.

        The opener to use is automatically determined based on available IOPlugins; see IOService.getOpener(String).

        Specified by:
        open in interface IOService
        Parameters:
        source - The source (e.g., file path) from which to data should be loaded.
        Returns:
        An object representing the loaded data, or null if the source is not supported.
        Throws:
        IOException - if something goes wrong loading the data.
      • save

        public void save​(Object data,
                         String destination)
                  throws IOException
        Description copied from interface: IOService
        Saves data to the given destination. The nature of the destination is left intentionally general, but the most common example is a file path.

        The saver to use is automatically determined based on available IOPlugins; see IOService.getSaver(Object, String).

        Specified by:
        save in interface IOService
        Parameters:
        data - The data to be saved to the destination.
        destination - The destination (e.g., file path) to which data should be saved.
        Throws:
        IOException - if something goes wrong saving the data.
      • open

        public Object open​(Location source)
                    throws IOException
        Description copied from interface: IOService
        Loads data from the given location.

        The opener to use is automatically determined based on available IOPlugins; see IOService.getOpener(Location).

        Specified by:
        open in interface IOService
        Parameters:
        source - The location from which to data should be loaded.
        Returns:
        An object representing the loaded data, or null if the source is not supported.
        Throws:
        IOException - if something goes wrong loading the data.
      • save

        public void save​(Object data,
                         Location destination)
                  throws IOException
        Description copied from interface: IOService
        Saves data to the given location.

        The saver to use is automatically determined based on available IOPlugins; see IOService.getSaver(Object, Location).

        Specified by:
        save in interface IOService
        Parameters:
        data - The data to be saved to the destination.
        destination - The destination location to which data should be saved.
        Throws:
        IOException - if something goes wrong saving the data.