public static Application getApplicationFromSource ( final File _versionFile , final List < String > _classpathElements , final File _eFapsDir , final File _outputDir , final List < String > _includes , final List < String > _excludes , final Map < String , String > _file2typeMapping ) throws InstallationException { final Map < String , String > file2typeMapping = _file2typeMapping == null ? Application . DEFAULT_TYPE_MAPPING : _file2typeMapping ; final Application appl ; try { appl = Application . getApplication ( _versionFile . toURI ( ) . toURL ( ) , _eFapsDir . toURI ( ) . toURL ( ) , _classpathElements ) ; for ( final String fileName : Application . getFiles ( _eFapsDir , _includes , _excludes ) ) { final String type = file2typeMapping . get ( fileName . substring ( fileName . lastIndexOf ( "." ) + 1 ) ) ; appl . install . addFile ( new InstallFile ( ) . setType ( type ) . setURL ( new File ( _eFapsDir , fileName ) . toURI ( ) . toURL ( ) ) ) ; } if ( _outputDir . exists ( ) ) { for ( final String fileName : Application . getFiles ( _outputDir , _includes , _excludes ) ) { final String type = file2typeMapping . get ( fileName . substring ( fileName . lastIndexOf ( "." ) + 1 ) ) ; appl . install . addFile ( new InstallFile ( ) . setType ( type ) . setURL ( new File ( _outputDir , fileName ) . toURI ( ) . toURL ( ) ) ) ; } } } catch ( final IOException e ) { throw new InstallationException ( "Could not open / read version file " + "'" + _versionFile + "'" , e ) ; // CHECKSTYLE:OFF } catch ( final Exception e ) { // CHECKSTYLE:ON throw new InstallationException ( "Read version file '" + _versionFile + "' failed" , e ) ; } return appl ; }
Returns the application definition read from a source directory .