Class AssetPath

java.lang.Object
com.hypixel.hytale.procedurallib.file.AssetPath

public final class AssetPath extends Object
Represents the path to an asset. This object holds both the relative path of the asset and the absolute 'real' file that gets loaded. This object can be to uniquely identify assets when the filesystem consists of multiple asset directory roots that potentially contain one or more versions of the same asset.
  • Field Details

  • Method Details

    • rename

      @Nonnull public AssetPath rename(@Nonnull String filename)
    • path

      @Nonnull public Path path()
    • filepath

      @Nonnull public Path filepath()
    • getFileName

      @Nonnull public String getFileName()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • fromAbsolute

      public static AssetPath fromAbsolute(@Nonnull Path root, @Nonnull Path filepath)
      Create an AssetPath from a root and absolute file path.
      Parameters:
      root - The path to the root asset directory.
      filepath - The absolute path to the asset.
      Returns:
      A new AssetPath instance for the asset.
    • fromRelative

      public static AssetPath fromRelative(@Nonnull Path root, @Nonnull Path assetPath)
      Create an AssetPath from a root and a relative asset path.
      Parameters:
      root - The path to the root asset directory.
      assetPath - The path to the asset relative to the root.
      Returns:
      A new AssetPath instance for the asset.