@Test public void testCreate() throws IOException { final String tempDir = new File(System.getProperty("java.io.tmpdir")).getCanonicalPath(); final FileSinkFactory factory = new FileSinkFactory(tempDir); final FileSink sink = (FileSink)factory.createSink("bar.baz.Blah"); try { assertTrue("Output file did not exist", sink.outputFile.exists()); assertEquals(new File(tempDir + "/bar/baz/Blah.java").getCanonicalPath(), sink.outputFile.getCanonicalPath()); } finally { sink.outputFile.delete(); } }
@Override public Sink createSink(String className) { return new FileSink(convertToPath(className)); }
FileSinkFactory implements SinkFactory { @Override public Sink createSink(String className) { return new FileSink(convertToPath(className)); } }
FileSinkFactory implements SinkFactory { @Override public Sink createSink(String className) { return new FileSink(convertToPath(className)); } FileSinkFactory(String destDirName); }
FileSinkFactory implements SinkFactory { @Override public Sink createSink(String className) { return new FileSink(convertToPath(className)); } FileSinkFactory(String destDirName); @Override Sink createSink(String className); String convertToPath(String className); }
FileSinkFactory implements SinkFactory { @Override public Sink createSink(String className) { return new FileSink(convertToPath(className)); } FileSinkFactory(String destDirName); @Override Sink createSink(String className); String convertToPath(String className);  }