@Test public void testTermServerExportForExtension() { assertEquals("rvf_prodms_main_20180731_usfix_20180901_20180817104834", generate("prod-ms_main_2018-07-31_SNOMEDCT-USFIX_2018-09-01_20180817104834.zip")); }
public static String generate(String releaseFilename) { if (releaseFilename != null && !releaseFilename.endsWith(".zip")) { return releaseFilename.replaceAll("-", "_"); } releaseFilename = releaseFilename.replace(".zip", ""); String[] splits = releaseFilename.split("_", -1); for (int i = 0; i < splits.length; i++) { splits[i] = splits[i].toLowerCase(); for (String word : REPLACEMENTS.keySet()) { if (splits[i].contains(word.toLowerCase())) { splits[i] = splits[i].replaceAll(word.toLowerCase(), REPLACEMENTS.get(word)); } } } StringBuilder builder = new StringBuilder(); for (String part : splits) { if (!part.trim().isEmpty()) { if (builder.length() > 0) { builder.append("_"); } builder.append(part); } } return "rvf_" + builder.toString(); }
RvfReleaseDbSchemaNameGenerator { public static String generate(String releaseFilename) { if (releaseFilename != null && !releaseFilename.endsWith(".zip")) { return releaseFilename.replaceAll("-", "_"); } releaseFilename = releaseFilename.replace(".zip", ""); String[] splits = releaseFilename.split("_", -1); for (int i = 0; i < splits.length; i++) { splits[i] = splits[i].toLowerCase(); for (String word : REPLACEMENTS.keySet()) { if (splits[i].contains(word.toLowerCase())) { splits[i] = splits[i].replaceAll(word.toLowerCase(), REPLACEMENTS.get(word)); } } } StringBuilder builder = new StringBuilder(); for (String part : splits) { if (!part.trim().isEmpty()) { if (builder.length() > 0) { builder.append("_"); } builder.append(part); } } return "rvf_" + builder.toString(); } }
RvfReleaseDbSchemaNameGenerator { public static String generate(String releaseFilename) { if (releaseFilename != null && !releaseFilename.endsWith(".zip")) { return releaseFilename.replaceAll("-", "_"); } releaseFilename = releaseFilename.replace(".zip", ""); String[] splits = releaseFilename.split("_", -1); for (int i = 0; i < splits.length; i++) { splits[i] = splits[i].toLowerCase(); for (String word : REPLACEMENTS.keySet()) { if (splits[i].contains(word.toLowerCase())) { splits[i] = splits[i].replaceAll(word.toLowerCase(), REPLACEMENTS.get(word)); } } } StringBuilder builder = new StringBuilder(); for (String part : splits) { if (!part.trim().isEmpty()) { if (builder.length() > 0) { builder.append("_"); } builder.append(part); } } return "rvf_" + builder.toString(); }  }
RvfReleaseDbSchemaNameGenerator { public static String generate(String releaseFilename) { if (releaseFilename != null && !releaseFilename.endsWith(".zip")) { return releaseFilename.replaceAll("-", "_"); } releaseFilename = releaseFilename.replace(".zip", ""); String[] splits = releaseFilename.split("_", -1); for (int i = 0; i < splits.length; i++) { splits[i] = splits[i].toLowerCase(); for (String word : REPLACEMENTS.keySet()) { if (splits[i].contains(word.toLowerCase())) { splits[i] = splits[i].replaceAll(word.toLowerCase(), REPLACEMENTS.get(word)); } } } StringBuilder builder = new StringBuilder(); for (String part : splits) { if (!part.trim().isEmpty()) { if (builder.length() > 0) { builder.append("_"); } builder.append(part); } } return "rvf_" + builder.toString(); }  static String generate(String releaseFilename); }
RvfReleaseDbSchemaNameGenerator { public static String generate(String releaseFilename) { if (releaseFilename != null && !releaseFilename.endsWith(".zip")) { return releaseFilename.replaceAll("-", "_"); } releaseFilename = releaseFilename.replace(".zip", ""); String[] splits = releaseFilename.split("_", -1); for (int i = 0; i < splits.length; i++) { splits[i] = splits[i].toLowerCase(); for (String word : REPLACEMENTS.keySet()) { if (splits[i].contains(word.toLowerCase())) { splits[i] = splits[i].replaceAll(word.toLowerCase(), REPLACEMENTS.get(word)); } } } StringBuilder builder = new StringBuilder(); for (String part : splits) { if (!part.trim().isEmpty()) { if (builder.length() > 0) { builder.append("_"); } builder.append(part); } } return "rvf_" + builder.toString(); }  static String generate(String releaseFilename);  }