@Test public void testCleanReversedInstancePath() { Assert.assertEquals( "", DockerAndScriptUtils.cleanReversedInstancePath( "" )); Assert.assertEquals( "root", DockerAndScriptUtils.cleanReversedInstancePath( "/root" )); Assert.assertEquals( "app_1_web_server_root", DockerAndScriptUtils.cleanReversedInstancePath( "/root/web server/app-1" )); }
public static String cleanReversedInstancePath( String instancePath ) { StringBuilder sb = new StringBuilder(); for( String s : instancePath.split( "/" )) { if( Utils.isEmptyOrWhitespaces( s )) continue; sb.insert( 0, s ); sb.insert( 0, "/" ); } return cleanInstancePath( sb.toString()); }
DockerAndScriptUtils { public static String cleanReversedInstancePath( String instancePath ) { StringBuilder sb = new StringBuilder(); for( String s : instancePath.split( "/" )) { if( Utils.isEmptyOrWhitespaces( s )) continue; sb.insert( 0, s ); sb.insert( 0, "/" ); } return cleanInstancePath( sb.toString()); } }
DockerAndScriptUtils { public static String cleanReversedInstancePath( String instancePath ) { StringBuilder sb = new StringBuilder(); for( String s : instancePath.split( "/" )) { if( Utils.isEmptyOrWhitespaces( s )) continue; sb.insert( 0, s ); sb.insert( 0, "/" ); } return cleanInstancePath( sb.toString()); } private  DockerAndScriptUtils(); }
DockerAndScriptUtils { public static String cleanReversedInstancePath( String instancePath ) { StringBuilder sb = new StringBuilder(); for( String s : instancePath.split( "/" )) { if( Utils.isEmptyOrWhitespaces( s )) continue; sb.insert( 0, s ); sb.insert( 0, "/" ); } return cleanInstancePath( sb.toString()); } private  DockerAndScriptUtils(); static Map<String,String> buildReferenceMap( Instance instance ); static String cleanInstancePath( String instancePath ); static String cleanReversedInstancePath( String instancePath ); }
DockerAndScriptUtils { public static String cleanReversedInstancePath( String instancePath ) { StringBuilder sb = new StringBuilder(); for( String s : instancePath.split( "/" )) { if( Utils.isEmptyOrWhitespaces( s )) continue; sb.insert( 0, s ); sb.insert( 0, "/" ); } return cleanInstancePath( sb.toString()); } private  DockerAndScriptUtils(); static Map<String,String> buildReferenceMap( Instance instance ); static String cleanInstancePath( String instancePath ); static String cleanReversedInstancePath( String instancePath ); static final String ROBOCONF_INSTANCE_NAME; static final String ROBOCONF_INSTANCE_PATH; static final String ROBOCONF_CLEAN_INSTANCE_PATH; static final String ROBOCONF_CLEAN_REVERSED_INSTANCE_PATH; static final String ROBOCONF_COMPONENT_NAME; }