@Test public void getFriendlyURIsUnsecure() { HadoopFileInputDialog dialog = mock( HadoopFileInputDialog.class ); when( dialog.getFriendlyURIs( any() ) ).thenCallRealMethod(); String[] files = new String[] { "hdfs: "hdfs: "hdfs: }; String[] friendly = dialog.getFriendlyURIs( files ); assertEquals( files[0], friendly[0] ); assertEquals( files[1], friendly[1] ); assertEquals( files[2], friendly[2] ); }
protected String[] getFriendlyURIs( String[] files ) { for ( int i = 0; i < files.length; i++ ) { String userinfo = URI.create( files[ i ] ).getUserInfo(); if ( userinfo != null ) { String[] credentials = userinfo.split( ":", 2 ); if ( credentials.length == 2 ) { credentials[ 1 ] = "***"; files[ i ] = files[ i ].replaceFirst( userinfo, String.join( ":", credentials ) ); } } } return files; }
HadoopFileInputDialog extends BaseStepDialog implements StepDialogInterface { protected String[] getFriendlyURIs( String[] files ) { for ( int i = 0; i < files.length; i++ ) { String userinfo = URI.create( files[ i ] ).getUserInfo(); if ( userinfo != null ) { String[] credentials = userinfo.split( ":", 2 ); if ( credentials.length == 2 ) { credentials[ 1 ] = "***"; files[ i ] = files[ i ].replaceFirst( userinfo, String.join( ":", credentials ) ); } } } return files; } }
HadoopFileInputDialog extends BaseStepDialog implements StepDialogInterface { protected String[] getFriendlyURIs( String[] files ) { for ( int i = 0; i < files.length; i++ ) { String userinfo = URI.create( files[ i ] ).getUserInfo(); if ( userinfo != null ) { String[] credentials = userinfo.split( ":", 2 ); if ( credentials.length == 2 ) { credentials[ 1 ] = "***"; files[ i ] = files[ i ].replaceFirst( userinfo, String.join( ":", credentials ) ); } } } return files; } HadoopFileInputDialog( Shell parent, Object in, TransMeta transMeta, String sname ); }
HadoopFileInputDialog extends BaseStepDialog implements StepDialogInterface { protected String[] getFriendlyURIs( String[] files ) { for ( int i = 0; i < files.length; i++ ) { String userinfo = URI.create( files[ i ] ).getUserInfo(); if ( userinfo != null ) { String[] credentials = userinfo.split( ":", 2 ); if ( credentials.length == 2 ) { credentials[ 1 ] = "***"; files[ i ] = files[ i ].replaceFirst( userinfo, String.join( ":", credentials ) ); } } } return files; } HadoopFileInputDialog( Shell parent, Object in, TransMeta transMeta, String sname ); @Override String open(); void setFlags(); void getData( HadoopFileInputMeta meta ); static final int guessPrecision( double d ); static final int guessIntLength( double d ); static final int guessLength( double d ); @Override String toString(); }
HadoopFileInputDialog extends BaseStepDialog implements StepDialogInterface { protected String[] getFriendlyURIs( String[] files ) { for ( int i = 0; i < files.length; i++ ) { String userinfo = URI.create( files[ i ] ).getUserInfo(); if ( userinfo != null ) { String[] credentials = userinfo.split( ":", 2 ); if ( credentials.length == 2 ) { credentials[ 1 ] = "***"; files[ i ] = files[ i ].replaceFirst( userinfo, String.join( ":", credentials ) ); } } } return files; } HadoopFileInputDialog( Shell parent, Object in, TransMeta transMeta, String sname ); @Override String open(); void setFlags(); void getData( HadoopFileInputMeta meta ); static final int guessPrecision( double d ); static final int guessIntLength( double d ); static final int guessLength( double d ); @Override String toString(); static final String LOCAL_ENVIRONMENT; static final String STATIC_ENVIRONMENT; static final String S3_ENVIRONMENT; static final String BUTTON_BROWSE; static final String BUTTON_VARIABLE; static final String ERROR_TITLE; static final String TOOLTIP_VARIABLE; static final String LABEL_EXTENSION; static final int[] dateLengths; }