Skip to content

Commit

Permalink
Proper URL usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Frotty committed Jun 5, 2017
1 parent 2f40134 commit 9a7be8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
apply plugin: 'java'

group 'systems.crigges'
version '1.4.1'
version '1.4.2'

repositories {
jcenter()
Expand Down
13 changes: 4 additions & 9 deletions src/main/java/systems/crigges/jmpq3/JMpqEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import com.esotericsoftware.minlog.Log;
import systems.crigges.jmpq3.BlockTable.Block;

import java.io.EOFException;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.*;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
Expand Down Expand Up @@ -258,12 +255,10 @@ private void setupTempDir() throws JMpqException {
private void loadDefaultListFile() throws IOException {
URL resource = getClass().getClassLoader().getResource("DefaultListfile.txt");
if (resource != null) {
String filePath = resource.getFile();
if(filePath.startsWith("file:\\")) {
Log.info("Invalid path detected");
filePath = filePath.substring(6);
Path defaultListfile = Paths.get("listfile");
try (InputStream is = resource.openStream()) {
Files.copy(is, defaultListfile);
}
Path defaultListfile = new File(filePath).toPath();
listFile = new Listfile(Files.readAllBytes(defaultListfile));
canWrite = false;
}
Expand Down

0 comments on commit 9a7be8c

Please sign in to comment.