Interface DataFolder

All Superinterfaces:
GetClassLoader

public interface DataFolder extends GetClassLoader
An interface for Expansion to make it easier to get the data folder
  • Method Details

    • normalizeJarPath

      static String normalizeJarPath(String path)
    • getDataFolder

      @NotNull default @NotNull File getDataFolder()
      Get the data folder of the expansion
      Returns:
      the data folder
    • getResource

      @Nullable default @Nullable InputStream getResource(@NotNull @NotNull String path)
      Get the resource from the expansion jar
      Parameters:
      path - path to resource
      Returns:
      the InputStream of the resource, or null if it's not found
    • saveResource

      default void saveResource(@NotNull @NotNull String path, boolean replace)
      Copy the resource from the expansion jar
      Parameters:
      path - path to resource
      replace - whether it replaces the existed one