PreviousEngine { protected String convertToFullFilename(String relpath_or_package, String filename, String domain) throws Exception { if (relpath_or_package != null && ".".equals(relpath_or_package.trim())) { log.warn("******** BUG IN FilenameUtils ==============> " + normalize(relpath_or_package.replace('.', separatorChar) + separatorChar + filename)); throw new Exception("not a good practice, please clean up your template relative path, you may set it to empty string... :" + relpath_or_package + ", " + filename); } String ret; if (hasLength(relpath_or_package)) { ret = normalize(relpath_or_package.replace('.', separatorChar) + separatorChar + filename); } else { ret = filename; } if (hasLength(domain)) { return normalize(domain + File.separator + ret); } else { return ret; } }  String enableDynaImports(); String setCurrentFilename(String filePath, String filename, String userDomainPath, String generatedDomainPath); String getCurrentClass(); String getCurrentRootClass(); String getCurrentRootCast(String... generics); String getCurrentClassWithout_(); String getCurrentAbstract(); void processDynamicFile(Map<String, Object> context, TemplatePack templatePack, Template template); OutputResult getOutputResult(); void setOutputResult(OutputResult outputResult); void stopFileGeneration();  }
@Test public void convertToFullFilename() throws Exception { PreviousEngine pe = new PreviousEngine(); String ffn = pe.convertToFullFilename("com.jaxio", "MyUtil.java", "src/main/something"); assertThat(normalize("src/main/something/com/jaxio/MyUtil.java")).isEqualTo(ffn); ffn = pe.convertToFullFilename(null, "MyUtil.java", "src/main/something"); assertThat(normalize("src/main/something/MyUtil.java")).isEqualTo(ffn); ffn = pe.convertToFullFilename(null, "MyUtil.java", null); assertThat("MyUtil.java").isEqualTo(ffn); ffn = pe.convertToFullFilename("com\\jaxio", "MyUtil.java", "src/main\\something"); assertThat(normalize("src/main/something/com/jaxio/MyUtil.java")).isEqualTo(ffn); }