update monero binaries in app directory #655

This commit is contained in:
woodser 2023-08-09 15:35:46 -04:00
parent 3c8c0034d0
commit 586a2478fc
4 changed files with 18 additions and 5 deletions

View file

@ -25,6 +25,7 @@ import org.apache.commons.io.IOUtils;
import javax.annotation.Nullable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -175,6 +176,16 @@ public class FileUtil {
}
}
public static boolean resourceEqualToFile(String resourcePath,
File destinationFile) throws ResourceNotFoundException, IOException {
try (InputStream inputStream = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) {
if (inputStream == null) {
throw new ResourceNotFoundException(resourcePath);
}
return IOUtils.contentEquals(inputStream, new FileInputStream(destinationFile));
}
}
public static void renameFile(File oldFile, File newFile) throws IOException {
if (Utilities.isWindows()) {
// Work around an issue on Windows whereby you can't rename over existing files.