Class Files

java.lang.Object
dev.vortex.api.Files

public final class Files extends Object
Utility class for opening and accessing Vortex files.

This class provides static methods to open Vortex files from various sources, including local file system paths and URIs. It supports both simple path-based access and more advanced configuration through properties.

All methods in this class are static and the class cannot be instantiated.

Since:
1.0
  • Method Details

    • open

      public static File open(String path)
      Opens a Vortex file from the specified path string.

      This method provides a convenient way to open Vortex files using either absolute file system paths or URI strings. If the path starts with "/", it is treated as an absolute file system path and converted to a file URI. Otherwise, it is parsed as a URI directly.

      This is equivalent to calling open(uri, Map.of()) with no additional properties.

      Parameters:
      path - the path to the Vortex file, either as an absolute file system path (starting with "/") or as a URI string
      Returns:
      a File instance representing the opened Vortex file
      Throws:
      RuntimeException - if the file cannot be opened or the path is invalid
      NullPointerException - if path is null
      See Also:
    • open

      public static File open(URI uri, Map<String,String> properties)
      Opens a Vortex file from the specified URI with additional properties.

      This method provides the most flexible way to open Vortex files, allowing you to specify both the location via a URI and additional configuration properties. The URI can point to local files, remote resources, or other supported storage systems.

      The properties map can be used to pass configuration options to the underlying file system or storage layer. The specific properties supported depend on the URI scheme and storage backend being used.

      Parameters:
      uri - the URI pointing to the Vortex file to open
      properties - a map of configuration properties for opening the file; may be empty but must not be null
      Returns:
      a File instance representing the opened Vortex file
      Throws:
      RuntimeException - if the file cannot be opened, the URI is invalid, or the returned native pointer is invalid
      NullPointerException - if uri or properties is null
      See Also: