@Test public void testFactorySlash() { final FileSinkFactory factory = new FileSinkFactory("/germufabits/"); final String path = factory.convertToPath("hello.world"); assertEqualsBarringFileSeparators("/germufabits/hello/world.java", path); }
public String convertToPath(String className) { final String fixedDir = destDirName.endsWith(File.separator) ? destDirName: destDirName + File.separator; final String fixedClassName = className.replace('.', '/'); return fixedDir + fixedClassName + ".java"; }
FileSinkFactory implements SinkFactory { public String convertToPath(String className) { final String fixedDir = destDirName.endsWith(File.separator) ? destDirName: destDirName + File.separator; final String fixedClassName = className.replace('.', '/'); return fixedDir + fixedClassName + ".java"; } }
FileSinkFactory implements SinkFactory { public String convertToPath(String className) { final String fixedDir = destDirName.endsWith(File.separator) ? destDirName: destDirName + File.separator; final String fixedClassName = className.replace('.', '/'); return fixedDir + fixedClassName + ".java"; } FileSinkFactory(String destDirName); }
FileSinkFactory implements SinkFactory { public String convertToPath(String className) { final String fixedDir = destDirName.endsWith(File.separator) ? destDirName: destDirName + File.separator; final String fixedClassName = className.replace('.', '/'); return fixedDir + fixedClassName + ".java"; } FileSinkFactory(String destDirName); @Override Sink createSink(String className); String convertToPath(String className); }
FileSinkFactory implements SinkFactory { public String convertToPath(String className) { final String fixedDir = destDirName.endsWith(File.separator) ? destDirName: destDirName + File.separator; final String fixedClassName = className.replace('.', '/'); return fixedDir + fixedClassName + ".java"; } FileSinkFactory(String destDirName); @Override Sink createSink(String className); String convertToPath(String className);  }