Class BMNConfigDirectory.BMNCopy

java.lang.Object
com.technicjelle.BMUtils.BMNative.BMNConfigDirectory.BMNCopy
Enclosing class:
BMNConfigDirectory

public static class BMNConfigDirectory.BMNCopy extends Object
Utility functions for copying stuff to the config directory that BMUtils allocated.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    fromFile(@NotNull BlueMapAPI blueMapAPI, @NotNull ClassLoader classLoader, @NotNull Path from, @NotNull String toFile, boolean overwrite)
    Every native BlueMap addon has its own config directory, which is allocated by BlueMap.
    This function copies a file to that directory.
    static void
    fromJarResource(@NotNull BlueMapAPI blueMapAPI, @NotNull ClassLoader classLoader, @NotNull String fromResource, @NotNull String toFile, boolean overwrite)
    Every native BlueMap addon has its own config directory, which is allocated by BlueMap.
    This function copies a resource from the jar to that directory.
    static void
    fromStream(@NotNull BlueMapAPI blueMapAPI, @NotNull ClassLoader classLoader, @NotNull InputStream in, @NotNull String toFile, boolean overwrite)
    Every native BlueMap addon has its own config directory, which is allocated by BlueMap.
    This function copies a stream to that directory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • fromStream

      public static void fromStream(@NotNull @NotNull BlueMapAPI blueMapAPI, @NotNull @NotNull ClassLoader classLoader, @NotNull @NotNull InputStream in, @NotNull @NotNull String toFile, boolean overwrite) throws IOException
      Every native BlueMap addon has its own config directory, which is allocated by BlueMap.
      This function copies a stream to that directory.
      Parameters:
      blueMapAPI - The BlueMapAPI instance
      classLoader - The class loader to get the addon ID from
      in - The input stream to copy from
      toFile - The asset to copy to, relative to the allocated config directory
      overwrite - Whether to overwrite the asset if it already exists
      Throws:
      IOException - If the stream could not be copied
    • fromFile

      public static void fromFile(@NotNull @NotNull BlueMapAPI blueMapAPI, @NotNull @NotNull ClassLoader classLoader, @NotNull @NotNull Path from, @NotNull @NotNull String toFile, boolean overwrite) throws IOException
      Every native BlueMap addon has its own config directory, which is allocated by BlueMap.
      This function copies a file to that directory.
      Parameters:
      blueMapAPI - The BlueMapAPI instance
      classLoader - The class loader to get the addon ID from
      from - The file to copy
      toFile - The file to copy to, relative to the allocated config directory
      overwrite - Whether to overwrite the asset if it already exists
      Throws:
      IOException - If the file could not be found or copied
    • fromJarResource

      public static void fromJarResource(@NotNull @NotNull BlueMapAPI blueMapAPI, @NotNull @NotNull ClassLoader classLoader, @NotNull @NotNull String fromResource, @NotNull @NotNull String toFile, boolean overwrite) throws IOException
      Every native BlueMap addon has its own config directory, which is allocated by BlueMap.
      This function copies a resource from the jar to that directory.
      Parameters:
      blueMapAPI - The BlueMapAPI instance
      classLoader - The class loader to get the addon ID from and to get the resource out of the jar from
      fromResource - The resource to copy from the jar
      toFile - The file to copy to, relative to the allocated config directory
      overwrite - Whether to overwrite the asset if it already exists
      Throws:
      IOException - If the resource could not be found or copied