public void close() throws Exception { if ( file != null ) { file.close(); } this.documents = null; this.yaml = null; }
public void shutdown() { if ( destinationFolderObject != null ) { try { destinationFolderObject.close(); } catch ( IOException ex ) { /* Ignore */ } } } }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ZipFileMeta) smi; data = (ZipFileData) sdi; if ( data.sourceFile != null ) { try { data.sourceFile.close(); } catch ( Exception e ) { // Ignore errors } } if ( data.zipFile != null ) { try { data.zipFile.close(); } catch ( Exception e ) { // Ignore errors } } super.dispose( smi, sdi ); } }
@Override public void close() throws IOException { try { this.closer.close(); } catch (IOException ioe) { LOGGER.error("Failed to close the input stream", ioe); } try { this.fileObject.close(); } catch (IOException ioe) { LOGGER.error("Failed to close the file object", ioe); } } }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ProcessFilesMeta) smi; data = (ProcessFilesData) sdi; if ( data.sourceFile != null ) { try { data.sourceFile.close(); data.sourceFile = null; } catch ( Exception e ) { // Ignore errors } } if ( data.targetFile != null ) { try { data.targetFile.close(); data.targetFile = null; } catch ( Exception e ) { // Ignore errors } } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (LoadFileInputMeta) smi; data = (LoadFileInputData) sdi; if ( data.file != null ) { try { data.file.close(); } catch ( Exception e ) { // Ignore errors } } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ChangeFileEncodingMeta) smi; data = (ChangeFileEncodingData) sdi; if ( data.sourceFile != null ) { try { data.sourceFile.close(); } catch ( Exception e ) { // ignore } } super.dispose( smi, sdi ); } }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (FileExistsMeta) smi; data = (FileExistsData) sdi; if ( data.file != null ) { try { data.file.close(); data.file = null; } catch ( Exception e ) { // Ignore close errors } } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (GetSubFoldersMeta) smi; data = (GetSubFoldersData) sdi; if ( data.file != null ) { try { data.file.close(); data.file = null; } catch ( Exception e ) { // Ignore close errors } } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (GetFileNamesMeta) smi; data = (GetFileNamesData) sdi; if ( data.file != null ) { try { data.file.close(); data.file = null; } catch ( Exception e ) { // Ignore close errors } } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (LDIFInputMeta) smi; data = (LDIFInputData) sdi; if ( data.file != null ) { try { data.file.close(); } catch ( Exception e ) { // Ignore errors } } if ( data.InputLDIF != null ) { data.InputLDIF = null; } if ( data.attributes_LDIF != null ) { data.attributes_LDIF = null; } if ( data.recordLDIF != null ) { data.recordLDIF = null; } super.dispose( smi, sdi ); }
public boolean includeFile( FileSelectInfo info ) { FileObject fileObject = info.getFile(); try { if ( fileObject == null ) { return false; } } catch ( Exception ex ) { // Upon error don't process the file. return false; } finally { if ( fileObject != null ) { try { fileObject.close(); fileObject = null; } catch ( IOException ex ) { /* Ignore */ } } } return true; } } );
public boolean includeFile( FileSelectInfo info ) { FileObject fileObject = info.getFile(); try { if ( fileObject == null ) { return false; } } catch ( Exception ex ) { // Upon error don't process the file. return false; } finally { if ( fileObject != null ) { try { fileObject.close(); fileObject = null; } catch ( IOException ex ) { /* Ignore */ } } } return true; } } );
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (YamlInputMeta) smi; data = (YamlInputData) sdi; if ( data.yaml != null ) { try { data.yaml.close(); } catch ( Exception e ) { // Ignore } } if ( data.file != null ) { try { data.file.close(); } catch ( Exception e ) { // Ignore } } super.dispose( smi, sdi ); }
public static boolean fileExists( String vfsFilename, VariableSpace space ) throws KettleFileException { FileObject fileObject = null; try { fileObject = getFileObject( vfsFilename, space ); return fileObject.exists(); } catch ( IOException e ) { throw new KettleFileException( e ); } finally { if ( fileObject != null ) { try { fileObject.close(); } catch ( Exception e ) { /* Ignore */ } } } }
@Override public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (TextFileInputMeta) smi; data = (TextFileInputData) sdi; if ( data.file != null ) { try { data.file.close(); data.file = null; } catch ( Exception e ) { log.logError( "Error closing file", e ); } } if ( data.in != null ) { BaseStep.closeQuietly( data.in ); data.in = null; } super.dispose( smi, sdi ); }
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (GetFilesRowsCountMeta) smi; data = (GetFilesRowsCountData) sdi; if ( data.file != null ) { try { data.file.close(); data.file = null; } catch ( Exception e ) { log.logError( "Error closing file", e ); } } if ( data.fr != null ) { BaseStep.closeQuietly( data.fr ); data.fr = null; } if ( data.lineStringBuilder != null ) { data.lineStringBuilder = null; } super.dispose( smi, sdi ); }
/** * Close last opened file/ */ protected void closeLastFile() { if ( data.reader != null ) { try { data.reader.close(); } catch ( Exception ex ) { failAfterBadFile( "Error close reader" ); } data.reader = null; } if ( data.file != null ) { try { data.file.close(); } catch ( Exception ex ) { failAfterBadFile( "Error close file" ); } data.file = null; } }
@Override public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ExcelOutputMeta) smi; data = (ExcelOutputData) sdi; if ( data.oneFileOpened ) { closeFile(); } if ( data.file != null ) { try { data.file.close(); data.file = null; } catch ( Exception e ) { logDetailed( BaseMessages.getString( PKG, "ExcelOutput.Log.UnableToCloseFileDuringDispose", data.file.getPublicURIString() ), e ); } } data.fieldsWidth = null; data.headerImage = null; data.writableFont = null; data.ws = null; super.dispose( smi, sdi ); }
private String getFilename( VariableSpace space ) throws KettleStepException { FileObject file = null; try { file = KettleVFS.getFileObject( space.environmentSubstitute( getFileName() ) ); return KettleVFS.getFilename( file ); } catch ( Exception e ) { throw new KettleStepException( BaseMessages .getString( PKG, "RssOutput.Meta.ErrorGettingFile", getFileName() ), e ); } finally { if ( file != null ) { try { file.close(); } catch ( Exception e ) { /* Ignore */ } } } }