public void Dispose() { if (config != null) { config.Dispose(); config = null; } if (inputData != null) { inputData.Dispose(); inputData = null; } if (sqlContext != null) { sqlContext.Dispose(); } if (logWriter != null) { logWriter.Dispose(); logWriter = null; } if (outputTextWriter != null) { outputTextWriter.Dispose(); outputTextWriter = null; } }
/// <summary> /// /// </summary> public void Close() { try { WriteFooter(); } finally { writer.Dispose(); writer = null; } }
public void ShouldBeConstructedWithAGivenDelimiterAndTextFileWriterAtGivenPath(char delimiter, char expected) { var file = System.IO.File.Create("testFile.txt"); var filePath = ""; using (file) filePath = file.Name; var sut = new TextFileWriter(filePath, delimiter); Assert.That(sut.Delimiter, Is.EqualTo(expected)); Assert.That(sut.FilePath, Is.EqualTo(filePath)); sut.Dispose(); System.IO.File.Delete(filePath); }
public void Dispose() { lock (this) { if (!Disposed) { Disposed = true; GC.SuppressFinalize(this); if (FTextWriter != null) { FTextWriter.Dispose(); FTextWriter = null; } } } }
public void Dispose() { _writer.Dispose(); }