}
if ( "RFC822.TEXT".equalsIgnoreCase( name ) ) {
return new BodyFetchElement( "RFC822.TEXT", "TEXT", false );
}
else {
throw new ProtocolException( "Invalid fetch attribute: " + name );
}
}
else {
consumeChar( request, '[' );
StringBuffer sectionIdentifier = new StringBuffer();
next = nextCharInLine( request );
while ( next != ']' ) {
sectionIdentifier.append( next );
request.consume();
next = nextCharInLine(request);
}
consumeChar( request, ']' );
String parameter = sectionIdentifier.toString();
if ( "BODY".equalsIgnoreCase( name ) ) {
return new BodyFetchElement( "BODY[" + parameter + "]", parameter, false );
}
if ( "BODY.PEEK".equalsIgnoreCase( name ) ) {
return new BodyFetchElement( "BODY[" + parameter + "]", parameter, true );
}
else {
throw new ProtocolException( "Invalid fetch attibute: " + name + "[]" );
}
}
}