Skip to content

Commit

Permalink
small patch
Browse files Browse the repository at this point in the history
  • Loading branch information
gosticks committed Jan 15, 2018
1 parent 1b8458d commit 105c3bb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/java/iotaFlashWrapper/IotaFlashBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -27,7 +25,6 @@ public class IotaFlashBridge {

public static void boot() throws IOException {
String file = readFile(iotaLibPath, Charset.defaultCharset());

engine = V8.createV8Runtime();
// Eval lib into current v8 context.
engine.executeVoidScript(file);
Expand Down Expand Up @@ -306,8 +303,7 @@ public static FlashObject applyTransfersToUser(UserObject user, ArrayList<Bundle
static String readFile(String path, Charset encoding)
throws IOException
{
URL url = IotaFlashBridge.class.getClassLoader().getResource(path);
File file = new File(url.getPath());
File file = new File(IotaFlashBridge.class.getClassLoader().getResource(path).getFile());
FileInputStream fis = new FileInputStream(file);
byte[] data = new byte[(int) file.length()];
fis.read(data);
Expand Down

0 comments on commit 105c3bb

Please sign in to comment.