public static void closeEmbeddedFileSystem( String embeddedMetastoreKey ) { if ( getInstance().getFileSystemManager() instanceof ConcurrentFileSystemManager ) { ( (ConcurrentFileSystemManager) getInstance().getFileSystemManager() ) .closeEmbeddedFileSystem( embeddedMetastoreKey ); } }
/** * Creates a file using "java.io.tmpdir" directory * * @param prefix - file name * @param prefix - file extension * @return FileObject * @throws KettleFileException */ public static FileObject createTempFile( String prefix, Suffix suffix ) throws KettleFileException { return createTempFile( prefix, suffix, TEMP_DIR ); }
SftpFileSystemWindows( GenericFileName rootName, Session session, FileSystemOptions fileSystemOptions ) { super( rootName, session, fileSystemOptions ); this.session = session; detectExecDisabled(); }
private FileObject getFileObjectFromKettleVFS( String filename ) throws KettleFileException { return KettleVFS.getFileObject( filename ); }
public static String getFriendlyURI( String filename ) { if ( filename == null ) { return null; } String friendlyName; try { friendlyName = getFriendlyURI( KettleVFS.getFileObject( filename ) ); } catch ( Exception e ) { // unable to get a friendly name from VFS object. // Cleanse name of pwd before returning friendlyName = cleanseFilename( filename ); } return friendlyName; }
public Log4jFileAppender( FileObject file ) throws IOException { this.file = file; fileOutputStream = KettleVFS.getOutputStream( file, false ); }
/** * Read a text file (like an XML document). WARNING DO NOT USE FOR DATA FILES. * * @param vfsFilename * the filename or URL to read from * @param charSetName * the character set of the string (UTF-8, ISO8859-1, etc) * @return The content of the file as a String * @throws IOException */ public static String getTextFileContent( String vfsFilename, String charSetName ) throws KettleFileException { return getTextFileContent( vfsFilename, null, charSetName ); }
/** * <p>Some SFTP-only servers disable the exec channel: attempt to detect this by calling getUid.</p> */ private void detectExecDisabled() { try { getUId(); } catch ( JSchException | IOException e ) { execDisabled = true; } }
@Override protected FileSystem doCreateFileSystem( FileName name, FileSystemOptions fileSystemOptions ) { return new SftpFileSystemWindows( (GenericFileName) name, null, fileSystemOptions ); }
@Override protected FileObject createFile( AbstractFileName name ) throws FileSystemException { return new SftpFileObjectWithWindowsSupport( name, this ); }
@Override public boolean isReleaseable() { return !isOpen(); }
public static FileObject getFileObject( String vfsFilename, VariableSpace space ) throws KettleFileException { return getFileObject( vfsFilename, space, null ); }
public Log4jFileAppender( FileObject file, boolean append ) throws IOException { this.file = file; fileOutputStream = KettleVFS.getOutputStream( file, append ); }
/** * * @param prefix - file name * @param suffix - file extension * @param directory - directory where file will be created * @return FileObject * @throws KettleFileException */ public static FileObject createTempFile( String prefix, Suffix suffix, String directory ) throws KettleFileException { return createTempFile( prefix, suffix, directory, null ); }
protected FileObject getFileObject( String vfsFilename, VariableSpace space ) throws KettleFileException { return KettleVFS.getFileObject( vfsFilename, space ); }
public static OutputStream getOutputStream( String vfsFilename, boolean append ) throws KettleFileException { return getOutputStream( vfsFilename, defaultVariableSpace, append ); }
/** * Creates a file using "java.io.tmpdir" directory * * @param prefix - file name * @param suffix - file extension * @param variableSpace is used to get system variables * @return FileObject * @throws KettleFileException */ public static FileObject createTempFile( String prefix, Suffix suffix, VariableSpace variableSpace ) throws KettleFileException { return createTempFile( prefix, suffix, TEMP_DIR, variableSpace ); }
public static FileObject getFileObject( String vfsFilename, FileSystemOptions fsOptions ) throws KettleFileException { return getFileObject( vfsFilename, defaultVariableSpace, fsOptions ); }
protected OutputStream getOutputStream( String vfsFilename, VariableSpace space, boolean append ) throws KettleFileException { return KettleVFS.getOutputStream( vfsFilename, space, append ); }
public static FileObject createTempFile( String prefix, String suffix, String directory ) throws KettleFileException { return createTempFile( prefix, suffix, directory, null ); }