@Test public void testCreateParentFolder() { String tempDir = TestUtils.createTempDir(); String suff = tempDir.substring( tempDir.lastIndexOf( File.separator ) + 1 ); tempDir += File.separator + suff + File.separator + suff; assertTrue( "Dir should be created", FileUtil.createParentFolder( getClass(), tempDir, true, new LogChannel( this ), null ) ); File fl = new File( tempDir.substring( 0, tempDir.lastIndexOf( File.separator ) ) ); assertTrue( "Dir should exist", fl.exists() ); fl.delete(); new File( tempDir ).delete(); }
@Test public void testIsFullyQualified() { assertTrue( FileUtil.isFullyQualified( "/test" ) ); assertTrue( FileUtil.isFullyQualified( "\\test" ) ); } }
final LogChannelFileWriter logChannelFileWriter; try { FileUtil.createParentFolder( AddTransServlet.class, realLogFilename, transExecutionConfiguration .isCreateParentFolder(), trans.getLogChannel(), trans ); logChannelFileWriter =
if ( !KettleVFS.startsWithScheme( filename ) && !FileUtil.isFullyQualified( filename ) ) { filepath = initialDir + filename;
String realLogFilename = transExecutionConfiguration.getLogFileName(); try { FileUtil.createParentFolder( AddTransServlet.class, realLogFilename, transExecutionConfiguration .isCreateParentFolder(), trans.getLogChannel(), trans ); final LogChannelFileWriter logChannelFileWriter =
public Job executeFilesystemBasedCommand( final String initialDir, final String filename ) throws Exception { if ( Utils.isEmpty( filename ) ) { return null; } blockAndThrow( getKettleInit() ); String fileName = filename; // If the filename starts with scheme like zip:, then isAbsolute() will return false even though // the path following the zip is absolute path. Check for isAbsolute only if the fileName does not start with scheme if ( !KettleVFS.startsWithScheme( fileName ) && !FileUtil.isFullyQualified( fileName ) ) { fileName = initialDir + fileName; } JobMeta jobMeta = new JobMeta( fileName, null, null ); return new Job( null, jobMeta ); }
if ( !FileUtil.createParentFolder( PKG, realLogFilename, createParentFolder, this.getLogChannel(), this ) ) { result.setNrErrors( 1 ); result.setResult( false );