java.lang.Object
ushiosan.jvm_utilities.internal.io.IOImpl
Direct Known Subclasses:
IO

public abstract class IOImpl extends Object
Base class containing functionality for input and output elements
  • Field Details

  • Constructor Details

    • IOImpl

      protected IOImpl()
      This class cannot be instantiated.

      Singleton or utility class mode.

  • Method Details

    • getValidFilesystem

      @NotNull protected static @NotNull FileSystem getValidFilesystem(@NotNull @NotNull URL url) throws IOException
      Returns a valid file system depending on the scheme of the given url
      Parameters:
      url - the url to inspect
      Returns:
      valid filesystem
      Throws:
      IOException - error if url schema is not supported
    • getValidFilesystem

      @NotNull protected static @NotNull FileSystem getValidFilesystem(@NotNull @NotNull URI uri) throws IOException
      Returns a valid file system depending on the scheme of the given url
      Parameters:
      uri - the url to inspect
      Returns:
      valid filesystem
      Throws:
      IOException - error if url schema is not supported
    • getValidPath

      @NotNull protected static @NotNull Path getValidPath(@NotNull @NotNull URL url) throws IOException
      Returns the path of an url in the file system (if the scheme is supported).

      If the schema is a jar file, the virtual representation of the file as a directory will be returned.

      Parameters:
      url - the url to inspect
      Returns:
      a valid file path
      Throws:
      IOException - error if given url is not supported
    • getValidPath

      @NotNull protected static @NotNull Path getValidPath(@NotNull @NotNull URI uri) throws IOException
      Returns the path of an url in the file system (if the scheme is supported).

      If the schema is a jar file, the virtual representation of the file as a directory will be returned.

      Parameters:
      uri - the url to inspect
      Returns:
      a valid file path
      Throws:
      IOException - error if given url is not supported