@Test public void testGetUrlPathRootPath() throws Exception { String prefix = HDFS_PREFIX; String pathBase = MY_HOST_URL; String expected = "/"; String fullPath = prefix + ":" + pathBase + expected; buildExtractSchemeMocks( prefix, fullPath, pathBase + expected ); assertEquals( expected, HadoopFileOutputDialog.getUrlPath( fullPath ) ); }
public static String getUrlPath( String incomingURL ) { String path = incomingURL; try { String noVariablesURL = incomingURL.replaceAll( "[${}]", "/" ); FileName fileName = KettleVFS.getInstance().getFileSystemManager().resolveURI( noVariablesURL ); String root = fileName.getRootURI().replaceFirst( "/$", "" ); if ( noVariablesURL.startsWith( root ) ) { path = incomingURL.length() > root.length() ? incomingURL.substring( root.length() ) : "/"; } } catch ( FileSystemException e ) { path = incomingURL; } return path; }
HadoopFileOutputDialog extends BaseStepDialog implements StepDialogInterface { public static String getUrlPath( String incomingURL ) { String path = incomingURL; try { String noVariablesURL = incomingURL.replaceAll( "[${}]", "/" ); FileName fileName = KettleVFS.getInstance().getFileSystemManager().resolveURI( noVariablesURL ); String root = fileName.getRootURI().replaceFirst( "/$", "" ); if ( noVariablesURL.startsWith( root ) ) { path = incomingURL.length() > root.length() ? incomingURL.substring( root.length() ) : "/"; } } catch ( FileSystemException e ) { path = incomingURL; } return path; } }
HadoopFileOutputDialog extends BaseStepDialog implements StepDialogInterface { public static String getUrlPath( String incomingURL ) { String path = incomingURL; try { String noVariablesURL = incomingURL.replaceAll( "[${}]", "/" ); FileName fileName = KettleVFS.getInstance().getFileSystemManager().resolveURI( noVariablesURL ); String root = fileName.getRootURI().replaceFirst( "/$", "" ); if ( noVariablesURL.startsWith( root ) ) { path = incomingURL.length() > root.length() ? incomingURL.substring( root.length() ) : "/"; } } catch ( FileSystemException e ) { path = incomingURL; } return path; } HadoopFileOutputDialog( Shell parent, Object in, TransMeta transMeta, String sname ); }
HadoopFileOutputDialog extends BaseStepDialog implements StepDialogInterface { public static String getUrlPath( String incomingURL ) { String path = incomingURL; try { String noVariablesURL = incomingURL.replaceAll( "[${}]", "/" ); FileName fileName = KettleVFS.getInstance().getFileSystemManager().resolveURI( noVariablesURL ); String root = fileName.getRootURI().replaceFirst( "/$", "" ); if ( noVariablesURL.startsWith( root ) ) { path = incomingURL.length() > root.length() ? incomingURL.substring( root.length() ) : "/"; } } catch ( FileSystemException e ) { path = incomingURL; } return path; } HadoopFileOutputDialog( Shell parent, Object in, TransMeta transMeta, String sname ); String open(); void getData(); void setMinimalWidth(); String toString(); static String getUrlPath( String incomingURL ); }
HadoopFileOutputDialog extends BaseStepDialog implements StepDialogInterface { public static String getUrlPath( String incomingURL ) { String path = incomingURL; try { String noVariablesURL = incomingURL.replaceAll( "[${}]", "/" ); FileName fileName = KettleVFS.getInstance().getFileSystemManager().resolveURI( noVariablesURL ); String root = fileName.getRootURI().replaceFirst( "/$", "" ); if ( noVariablesURL.startsWith( root ) ) { path = incomingURL.length() > root.length() ? incomingURL.substring( root.length() ) : "/"; } } catch ( FileSystemException e ) { path = incomingURL; } return path; } HadoopFileOutputDialog( Shell parent, Object in, TransMeta transMeta, String sname ); String open(); void getData(); void setMinimalWidth(); String toString(); static String getUrlPath( String incomingURL );  }