Class BMNConfigDirectory.BMNCopy
java.lang.Object
com.technicjelle.BMUtils.BMNative.BMNConfigDirectory.BMNCopy
- Enclosing class:
BMNConfigDirectory
Utility functions for copying stuff to the config directory that BMUtils allocated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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 instanceclassLoader
- The class loader to get the addon ID fromin
- The input stream to copy fromtoFile
- The asset to copy to, relative to the allocated config directoryoverwrite
- 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 instanceclassLoader
- The class loader to get the addon ID fromfrom
- The file to copytoFile
- The file to copy to, relative to the allocated config directoryoverwrite
- 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 instanceclassLoader
- The class loader to get the addon ID from and to get the resource out of the jar fromfromResource
- The resource to copy from the jartoFile
- The file to copy to, relative to the allocated config directoryoverwrite
- Whether to overwrite the asset if it already exists- Throws:
IOException
- If the resource could not be found or copied
-