@Test public void testFindIcon_tpl() throws Exception { File appDir = this.folder.newFolder(); ApplicationTemplate tpl = new ApplicationTemplate( "app" ).version( "v1" ).directory( appDir ); File descDir = new File( appDir, Constants.PROJECT_DIR_DESC ); Assert.assertTrue( descDir.mkdirs()); File trickFile = new File( descDir, "file.txt" ); Assert.assertTrue( trickFile.createNewFile()); Assert.assertNull( IconUtils.findIcon( tpl )); File singleJpgFile = new File( descDir, "whatever.jpg" ); Assert.assertTrue( singleJpgFile.createNewFile()); Assert.assertEquals( singleJpgFile, IconUtils.findIcon( tpl )); File defaultFile = new File( descDir, "application.sVg" ); Assert.assertTrue( defaultFile.createNewFile()); Assert.assertEquals( defaultFile, IconUtils.findIcon( tpl )); Assert.assertNull( IconUtils.findIcon( new ApplicationTemplate( "app" ).version( "" ))); Assert.assertNull( IconUtils.findIcon( new ApplicationTemplate( "app" ).version( "" ))); Assert.assertNull( IconUtils.findIcon( new ApplicationTemplate( "app" ).version( "v2" ))); }
public static File findIcon( AbstractApplication app ) { return findIcon( app.getDirectory()); }
IconUtils { public static File findIcon( AbstractApplication app ) { return findIcon( app.getDirectory()); } }
IconUtils { public static File findIcon( AbstractApplication app ) { return findIcon( app.getDirectory()); } private  IconUtils(); }
IconUtils { public static File findIcon( AbstractApplication app ) { return findIcon( app.getDirectory()); } private  IconUtils(); static String encodeIconUrl( String name, String version, File iconFile ); static Map.Entry<String,String> decodeIconUrl( String path ); static File findIcon( AbstractApplication app ); static String findIconUrl( AbstractApplication app ); static String findMimeType( File imgFile ); static File findIcon( File rootDirectory ); }
IconUtils { public static File findIcon( AbstractApplication app ) { return findIcon( app.getDirectory()); } private  IconUtils(); static String encodeIconUrl( String name, String version, File iconFile ); static Map.Entry<String,String> decodeIconUrl( String path ); static File findIcon( AbstractApplication app ); static String findIconUrl( AbstractApplication app ); static String findMimeType( File imgFile ); static File findIcon( File rootDirectory ); static final String MIME_JPG; static final String MIME_PNG; static final String MIME_SVG; static final String MIME_GIF; static final String MIME_BINARY; }