Skip to content

Commit

Permalink
Don't flood the tmp folder with duplicate libs
Browse files Browse the repository at this point in the history
  • Loading branch information
VixidDev committed Jun 28, 2024
1 parent 3d983f3 commit 162491e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx2g
baseGroup = dev.vixid.vsm
mcVersion = 1.8.9
modid = vsm
version = 1.0.0
version = 0.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;

/**
* JNativeHook library locator in the case that JNativeHook cannot find the jar otherwise
*/
public class VSMLibraryLocator implements NativeLibraryLocator {
private static final Logger log = Logger.getLogger(GlobalScreen.class.getPackage().getName());
public static final String tempDirName = "VSM-JNativeHookLib";

@Override
public Iterator<File> getLibraries() {
Expand All @@ -38,7 +41,6 @@ public Iterator<File> getLibraries() {

File libFile;
// https://stackoverflow.com/questions/1611357/how-to-make-a-jar-file-that-includes-dll-files
String tempDirName = "VSM_" + new Date().getTime();
try {
InputStream is = GlobalScreen.class.getResourceAsStream(libResourcePath);
libFile = new File(System.getProperty("java.io.tmpdir") + "/" + tempDirName + libResourcePath);
Expand Down

0 comments on commit 162491e

Please sign in to comment.