mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-23 07:00:49 -04:00
update monero binaries in app directory #655
This commit is contained in:
parent
3c8c0034d0
commit
586a2478fc
4 changed files with 18 additions and 5 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue