-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow customizing the native library installation
- Loading branch information
Showing
4 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/net/lostluma/battery/api/util/LibraryUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.lostluma.battery.api.util; | ||
|
||
import net.lostluma.battery.impl.util.NativeUtil; | ||
|
||
import java.nio.file.Path; | ||
|
||
/** | ||
* Optional utilities to customize library installation. | ||
*/ | ||
public class LibraryUtil { | ||
/** | ||
* Customize the directory for storing the dynamic library. | ||
* By default, this is a subfolder in the user's cache directory. | ||
* | ||
* @param path the new cache directory | ||
*/ | ||
public static void setCacheDir(Path path) { | ||
NativeUtil.setCacheDir(path); | ||
} | ||
|
||
/** | ||
* Customize whether the dynamic library may be automatically downloaded. | ||
* | ||
* @param value whether to allow automatic library downloading. Defaults to true. | ||
*/ | ||
public static void setAllowDownloads(boolean value) { | ||
NativeUtil.setAllowDownloads(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters