- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
private List< String > extractMetaDataLines()
{
final ArrayList< String > metaDataLines = new ArrayList< String >();
int currentLineIndex = 0;
int start = 0;
int end = 0;
for ( final String line : getLines() )
{
if ( line.contains( METADATA_TAG ) )
{
if ( line.contains( "</" ) )
{
end = currentLineIndex
- ( getLines().get( currentLineIndex - 1 ).contains( "]]>" ) ? 1
: 0 );
if ( line.contains( "<fx" )
|| line.contains( "<mx" ) )
{
start = end;
}
break;
}
if ( line.contains( "<" ) )
{
start = currentLineIndex
+ ( getLines().get( currentLineIndex + 1 ).contains( "CDATA[" ) ? 2
: 1 );
}
}
currentLineIndex++;
}
metaDataLines.addAll( getLines().subList( start,
end ) );
return metaDataLines;
}
codemonkey 16.02.2015 11:08 # 0