### Question:
IRODSFileWriter extends Writer { public IRODSFileWriter(final IRODSFile irodsFile, final IRODSFileFactory irodsFileFactory) throws IOException { super(); if (irodsFile == null) { throw new JargonRuntimeException("irodsFile Is null"); } if (irodsFileFactory == null) { throw new JargonRuntimeException("irodsFileFactory is null"); } try { irodsFileOutputStream = irodsFileFactory.instanceIRODSFileOutputStream(irodsFile); } catch (JargonException e) { throw new IOException("unable to open IRODSFileOutputStream for:" + irodsFile.getAbsolutePath()); } connectionEncoding = irodsFileOutputStream.getFileIOOperations().getIRODSSession() .buildPipelineConfigurationBasedOnJargonProperties().getDefaultEncoding(); } IRODSFileWriter(final IRODSFile irodsFile, final IRODSFileFactory irodsFileFactory); @Override void close(); @Override void flush(); @Override void write(final char[] cbuf, final int off, final int len); static Logger log; }### Answer:
@Test public void testIRODSFileWriter() throws Exception { String testFileName = "testCanWrite.txt"; String targetIrodsFile = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + '/' + testFileName); IRODSProtocolManager irodsConnectionManager = IRODSSimpleProtocolManager.instance(); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); IRODSSession irodsSession = IRODSSession.instance(irodsConnectionManager); IRODSAccessObjectFactory accessObjectFactory = IRODSAccessObjectFactoryImpl.instance(irodsSession); IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); IRODSFileWriter irodsFileWriter = irodsFileFactory.instanceIRODSFileWriter(targetIrodsFile); Assert.assertNotNull("null irodsFileWriter", irodsFileWriter); irodsSession.closeSession(); }