Stopped using getResource.

This commit is contained in:
Winston Li
2015-01-11 12:13:25 +00:00
parent 0dd12e5323
commit 517792517c
2 changed files with 9 additions and 10 deletions
@@ -12,10 +12,7 @@ import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIState;
import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIStateBuilder;
import uk.ac.ic.wlgitbridge.test.util.FileUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.*;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -82,15 +79,15 @@ public class WLGitBridgeIntegrationTest {
}
private Path getResource(String path) {
return Paths.get("src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest" + path);
}
private InputStream getResourceAsStream(String path) {
try {
return Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest" + path).toURI());
} catch (URISyntaxException e) {
return new FileInputStream(getResource(path).toFile());
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
private InputStream getResourceAsStream(String path) {
return getClass().getResourceAsStream("/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest" + path);
}
}