Skip to content

Commit

Permalink
Better indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tonihele committed Apr 28, 2024
1 parent 3bec764 commit dbaff3f
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,26 @@ private void initMatDef() {
matDef = manager.getAssetFolder().getFileObject(getMatDefName());

//try to read from classpath if not in assets folder and store in a virtual filesystem folder
if (matDef == null || !matDef.isValid()) {
try {
fs = FileUtil.createMemoryFileSystem();
matDef = fs.getRoot().createData(name, "j3md");
try ( OutputStream out = matDef.getOutputStream()) {
InputStream in = manager.getResourceAsStream(getMatDefName());
if (in != null) {
int input = in.read();
while (input != -1) {
out.write(input);
input = in.read();
}
in.close();
if (matDef != null && matDef.isValid()) {
return;
}

try {
fs = FileUtil.createMemoryFileSystem();
matDef = fs.getRoot().createData(name, "j3md");
try ( OutputStream out = matDef.getOutputStream()) {
InputStream in = manager.getResourceAsStream(getMatDefName());
if (in != null) {
int input = in.read();
while (input != -1) {
out.write(input);
input = in.read();
}
in.close();
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}

Expand Down

0 comments on commit dbaff3f

Please sign in to comment.