fanhualta commented on a change in pull request #33: Fix sonar problems
URL: https://github.com/apache/incubator-iotdb/pull/33#discussion_r251850327
##########
File path: iotdb-cli/src/main/java/org/apache/iotdb/cli/tool/ImportCsv.java
##########
@@ -423,6 +409,31 @@ public static void importCsvFromFile(String ip, String
port, String username,
connection.close();
}
}
+ }
+ private static void importFromSingleFile(File file) {
+ if (file.getName().endsWith(FILE_SUFFIX)) {
+ loadDataFromCSV(file, 1);
+ } else {
+ System.out.println(
+ "[WARN] File " + file.getName() + " should ends with '.csv' "
+ + "if you want to import");
+ }
+ }
+
+ private static void importFromDirectory(File file) {
+ int i = 1;
+ for (File subFile : file.listFiles()) {
+ if (subFile.isFile()) {
+ if (subFile.getName().endsWith(FILE_SUFFIX)) {
+ loadDataFromCSV(subFile, i);
+ i++;
+ } else {
+ System.out.println(
+ "[WARN] File " + subFile.getName() + " should ends with
'.csv' "
+ + "if you want to import");
Review comment:
It's better to convert all Syso to LOGGER. In this case, it's better to use
LOGGER.warn().
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services