Merge pull request #18 from bsinno/fix-sonar-issues
ok 👍 Fix sonar issue in UI file read
This commit is contained in:
@@ -207,16 +207,26 @@ public class BulkUploadHandler extends CustomComponent
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long innerCounter = 0;
|
||||
String line;
|
||||
if (tempFile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try (InputStream tempStream = new FileInputStream(tempFile)) {
|
||||
readFileStream(tempStream);
|
||||
} catch (final FileNotFoundException e) {
|
||||
LOG.error("Temporary file not found with name {}", tempFile.getName(), e);
|
||||
} catch (final IOException e) {
|
||||
LOG.error("Error while opening temorary file ", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void readFileStream(final InputStream tempStream) {
|
||||
String line;
|
||||
try (BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(tempStream, Charset.defaultCharset()))) {
|
||||
LOG.info("Bulk file upload started");
|
||||
long innerCounter = 0;
|
||||
final double totalFileSize = getTotalNumberOfLines();
|
||||
|
||||
/**
|
||||
@@ -240,12 +250,6 @@ public class BulkUploadHandler extends CustomComponent
|
||||
resetCounts();
|
||||
deleteFile();
|
||||
}
|
||||
} catch (final FileNotFoundException e) {
|
||||
LOG.error("Temporary file not found with name {}", tempFile.getName(), e);
|
||||
} catch (final IOException e) {
|
||||
LOG.error("Error while opening temorary file ", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void doAssignments() {
|
||||
|
||||
Reference in New Issue
Block a user