@Test void testGuessFormat() throws Exception { String[] inputs = new String[]{ "sample/conf/sampledoc1.adoc", "sample/conf/sampledoc2.adoc", }; assertEquals("asciidoc", Main.guessInputFormat(inputs)); }
static String guessInputFormat(String[] inputFileNames) { String inputFormat = ""; for (String inputFileName : inputFileNames) { String format = detectFormat(inputFileName); if (!inputFormat.equals("") && !format.equals(inputFormat)) { LOG.warn("There are more than one file type...: {} and {}", format, inputFormat); LOG.warn("Guess file format as plain..."); return "plain"; } inputFormat = format; } return inputFormat.equals("") ? "plain" : inputFormat; }
Main { static String guessInputFormat(String[] inputFileNames) { String inputFormat = ""; for (String inputFileName : inputFileNames) { String format = detectFormat(inputFileName); if (!inputFormat.equals("") && !format.equals(inputFormat)) { LOG.warn("There are more than one file type...: {} and {}", format, inputFormat); LOG.warn("Guess file format as plain..."); return "plain"; } inputFormat = format; } return inputFormat.equals("") ? "plain" : inputFormat; } }
Main { static String guessInputFormat(String[] inputFileNames) { String inputFormat = ""; for (String inputFileName : inputFileNames) { String format = detectFormat(inputFileName); if (!inputFormat.equals("") && !format.equals(inputFormat)) { LOG.warn("There are more than one file type...: {} and {}", format, inputFormat); LOG.warn("Guess file format as plain..."); return "plain"; } inputFormat = format; } return inputFormat.equals("") ? "plain" : inputFormat; } private  Main(); }
Main { static String guessInputFormat(String[] inputFileNames) { String inputFormat = ""; for (String inputFileName : inputFileNames) { String format = detectFormat(inputFileName); if (!inputFormat.equals("") && !format.equals(inputFormat)) { LOG.warn("There are more than one file type...: {} and {}", format, inputFormat); LOG.warn("Guess file format as plain..."); return "plain"; } inputFormat = format; } return inputFormat.equals("") ? "plain" : inputFormat; } private  Main(); static void main(String... args); @SuppressWarnings("static-access") static int run(String... args); }
Main { static String guessInputFormat(String[] inputFileNames) { String inputFormat = ""; for (String inputFileName : inputFileNames) { String format = detectFormat(inputFileName); if (!inputFormat.equals("") && !format.equals(inputFormat)) { LOG.warn("There are more than one file type...: {} and {}", format, inputFormat); LOG.warn("Guess file format as plain..."); return "plain"; } inputFormat = format; } return inputFormat.equals("") ? "plain" : inputFormat; } private  Main(); static void main(String... args); @SuppressWarnings("static-access") static int run(String... args);  }