Skip to content

Commit

Permalink
Fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Feb 19, 2024
1 parent e7c4736 commit 5a32636
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,18 @@ public Response check( ValInput input) {
return ValUtils.doIfInTmpFolder( tempFile, () -> {
Response res = null;
ValOutput output = null;
if ( FileIO.isInTmpFolder( tempFile ) ) {
try ( FileInputStream fis = new FileInputStream( tempFile ) ) {
DocTypeValidationResult result = facade.validate( file.fileName(), fis );
if (result.isResultOk()) {
output = new ValOutput(true, "Input is valid");
} else {
output = new ValOutput(false, "Input is not valid");
}
}
if (output.isValid()) {
res = Response.ok().entity(output).build();
try ( FileInputStream fis = new FileInputStream( tempFile ) ) {
DocTypeValidationResult result = facade.validate( file.fileName(), fis );
if (result.isResultOk()) {
output = new ValOutput(true, "Input is valid");
} else {
res = Response.status(Response.Status.BAD_REQUEST).entity(output).build();
output = new ValOutput(false, "Input is not valid");
}
}
if (output.isValid()) {
res = Response.ok().entity(output).build();
} else {
res = Response.status(Response.Status.UNAUTHORIZED).build();
res = Response.status(Response.Status.BAD_REQUEST).entity(output).build();
}
return res;
} );
Expand Down

0 comments on commit 5a32636

Please sign in to comment.