@Test public void getJarFileNameShouldReturnFileNameWithClassifier() { assertThat( EjbHelper.getJarFile( new File( "base" ), "test", "alpha" ) ).isEqualTo( new File( "base/test-alpha.jar" ) ); }
public static File getJarFile( File basedir, String finalName, String classifier ) { if ( basedir == null ) { throw new IllegalArgumentException( "basedir is not allowed to be null" ); } if ( finalName == null ) { throw new IllegalArgumentException( "finalName is not allowed to be null" ); } StringBuilder fileName = new StringBuilder( finalName ); if ( hasClassifier( classifier ) ) { fileName.append( "-" ).append( classifier ); } fileName.append( ".jar" ); return new File( basedir, fileName.toString() ); }
EjbHelper { public static File getJarFile( File basedir, String finalName, String classifier ) { if ( basedir == null ) { throw new IllegalArgumentException( "basedir is not allowed to be null" ); } if ( finalName == null ) { throw new IllegalArgumentException( "finalName is not allowed to be null" ); } StringBuilder fileName = new StringBuilder( finalName ); if ( hasClassifier( classifier ) ) { fileName.append( "-" ).append( classifier ); } fileName.append( ".jar" ); return new File( basedir, fileName.toString() ); } }
EjbHelper { public static File getJarFile( File basedir, String finalName, String classifier ) { if ( basedir == null ) { throw new IllegalArgumentException( "basedir is not allowed to be null" ); } if ( finalName == null ) { throw new IllegalArgumentException( "finalName is not allowed to be null" ); } StringBuilder fileName = new StringBuilder( finalName ); if ( hasClassifier( classifier ) ) { fileName.append( "-" ).append( classifier ); } fileName.append( ".jar" ); return new File( basedir, fileName.toString() ); } private  EjbHelper(); }
EjbHelper { public static File getJarFile( File basedir, String finalName, String classifier ) { if ( basedir == null ) { throw new IllegalArgumentException( "basedir is not allowed to be null" ); } if ( finalName == null ) { throw new IllegalArgumentException( "finalName is not allowed to be null" ); } StringBuilder fileName = new StringBuilder( finalName ); if ( hasClassifier( classifier ) ) { fileName.append( "-" ).append( classifier ); } fileName.append( ".jar" ); return new File( basedir, fileName.toString() ); } private  EjbHelper(); static boolean isClassifierValid( String classifier ); static boolean hasClassifier( String classifier ); static File getJarFile( File basedir, String finalName, String classifier ); }
EjbHelper { public static File getJarFile( File basedir, String finalName, String classifier ) { if ( basedir == null ) { throw new IllegalArgumentException( "basedir is not allowed to be null" ); } if ( finalName == null ) { throw new IllegalArgumentException( "finalName is not allowed to be null" ); } StringBuilder fileName = new StringBuilder( finalName ); if ( hasClassifier( classifier ) ) { fileName.append( "-" ).append( classifier ); } fileName.append( ".jar" ); return new File( basedir, fileName.toString() ); } private  EjbHelper(); static boolean isClassifierValid( String classifier ); static boolean hasClassifier( String classifier ); static File getJarFile( File basedir, String finalName, String classifier );  }