All Downloads are FREE. Search and download functionalities are using the official Maven repository.

flair.gradle.utils.CliDevicesOutputParser.groovy Maven / Gradle / Ivy

package flair.gradle.utils

/**
 * @author SamYStudiO ( [email protected] )
 */
public class CliDevicesOutputParser
{
	public CliDevicesOutputParser()
	{
	}

	public String parse( String adtOutput )
	{
		List list = new ArrayList( )

		boolean startExtraction = false

		adtOutput.eachLine {

			if( startExtraction && !it.startsWith( "Handle" ) ) list.add( it.trim( ).split( "\\s" )[ 0 ] )
			if( it.startsWith( "List of" ) ) startExtraction = true
		}

		return list.size( ) > 0 ? list[ 0 ] : null
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy