private boolean checkContainsFile( String realSourceDirectoryOrFile, FileObject[] filelist, boolean isDirectory ) throws FileSystemException { boolean retval = false; for ( int i = 0; i < filelist.length; i++ ) { FileObject file = filelist[i]; if ( ( file.exists() && file.getType().equals( FileType.FILE ) ) ) { retval = true; } } return retval; }
public static InputStream getInputStream( FileObject fileObject ) throws FileSystemException { FileContent content = fileObject.getContent(); return content.getInputStream(); }
FileSystemOptions fsOptions = new FileSystemOptions(); SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fsOptions, "no"); FileSystemManager fsManager = VFS.getManager(); String uri = "sftp://user:password@host:port/absolute-path"; FileObject fo = fsManager.resolveFile(uri, fsOptions);
@Override public boolean traverseDescendents( FileSelectInfo fileSelectInfo ) throws Exception { FileObject fileObject = fileSelectInfo.getFile(); String folder = fileObject.getName().getBaseName(); FileObject kettleIgnore = fileObject.getChild( ".kettle-ignore" ); return includeLibJars || ( kettleIgnore == null && !"lib".equals( folder ) ); }
public void handleFile( FileObject file ) throws KettleException { close(); this.processingFilename = file.getName().getBaseName(); }
@Override public boolean includeFile( FileSelectInfo info ) throws Exception { return info.getFile().getName().getExtension().equals( "java" ); } } );
public static String getFriendlyURI( FileObject fileObject ) { return fileObject.getName().getFriendlyURI(); }
public void close() throws Exception { if ( file != null ) { file.close(); } this.documents = null; this.yaml = null; }
protected FileSystemOptions getFileSystemOptions() throws FileSystemException { FileSystemOptions opts = new FileSystemOptions(); return opts; }
@Override public boolean traverseDescendents( FileSelectInfo info ) { return info.getDepth() == 0 || subdirs; }
/** * Returns the name of the file. * * @return the name, never null. */ public String getName() { return backend.getPublicURIString(); }
protected boolean handleOpenFileException( Exception e ) { String errorMsg = "Couldn't open file #" + data.currentFileIndex + " : " + data.file.getName().getFriendlyURI(); if ( !failAfterBadFile( errorMsg ) ) { // !meta.isSkipBadFiles()) stopAll(); return true; } stopAll(); setErrors( getErrors() + 1 ); logError( errorMsg, e ); return false; }
public void shutdown() { if ( destinationFolderObject != null ) { try { destinationFolderObject.close(); } catch ( IOException ex ) { /* Ignore */ } } } }
@Override public boolean traverseDescendents( FileSelectInfo info ) { return info.getDepth() == 0 || subdirs; }
public boolean traverseDescendents( FileSelectInfo info ) { return info.getDepth() == 0 || includeSubfolders; } }
public boolean traverseDescendents( FileSelectInfo info ) { return info.getDepth() == 0 || include_subfolders; }
public boolean traverseDescendents( FileSelectInfo info ) { return info.getDepth() == 0 || include_subfolders; }