public IFileInfo getFileInfo( ISolutionFile solutionFile, InputStream in ) {
try {
Document doc = XmlDom4JHelper.getDocFromStream( in );
IFileInfo info = new FileInfo();
Node node = doc.selectSingleNode( "state-file/documentation/author" ); //$NON-NLS-1$
if ( node != null ) {
info.setAuthor( node.getText() );
} else {
info.setAuthor( "" ); //$NON-NLS-1$
}
info.setDisplayType( "HTML" ); //$NON-NLS-1$
node = doc.selectSingleNode( "state-file/documentation/title" ); //$NON-NLS-1$
if ( node != null ) {
info.setTitle( node.getText() );
} else {
info.setTitle( "" ); //$NON-NLS-1$
}
node = doc.selectSingleNode( "state-file/documentation/description" ); //$NON-NLS-1$
if ( node != null ) {
info.setDescription( node.getText() );
} else {
info.setDescription( "" ); //$NON-NLS-1$
}
node = doc.selectSingleNode( "state-file/documentation/icon" ); //$NON-NLS-1$
if ( node != null ) {
info.setIcon( node.getText() );
} else {
info.setIcon( "" ); //$NON-NLS-1$
}
return info;
} catch ( Exception e ) {
if ( logger != null ) {
logger.error( getClass().toString(), e );