mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 02:25:49 +01:00
Stream is now properly recieved
This commit is contained in:
parent
2f9a9622db
commit
e12438e10e
@ -83,7 +83,7 @@ public class DataStorage {
|
||||
}
|
||||
if (!outFile.exists() || overwrite) {
|
||||
try {
|
||||
InputStream inputStream = DataStorage.class.getResourceAsStream(fileLoc);
|
||||
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(fileLoc);
|
||||
if(inputStream == null) {
|
||||
return false;
|
||||
}
|
||||
@ -125,8 +125,10 @@ public class DataStorage {
|
||||
File inFile = new File(dataFolder, location);
|
||||
if (inFile.exists() && !inFile.isDirectory()) {
|
||||
try {
|
||||
System.out.println("OUTPUT 1");
|
||||
return new FileInputStream(inFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("OUTPUT 2");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
@ -135,6 +137,7 @@ public class DataStorage {
|
||||
copyDefaultFile(location, false);
|
||||
return this.getClass().getClassLoader().getResourceAsStream(location);
|
||||
} catch (NullPointerException e) {
|
||||
System.out.println("OUTPUT 4");
|
||||
e.printStackTrace();
|
||||
AdvancedPortalsCore.getInfoLogger().logWarning("Could not load " + location + ". The file does" +
|
||||
"not exist or there has been an error reading the file.");
|
||||
|
Loading…
Reference in New Issue
Block a user