public boolean containsStartTag ( @ NotNull @ FileExists @ IsFile final File file , @ NotNull final String tagName ) { Contract . requireArgNotNull ( "file" , file ) ; FileExistsValidator . requireArgValid ( "file" , file ) ; IsFileValidator . requireArgValid ( "file" , file ) ; Contract . requireArgNotNull ( "tagName" , tagName ) ; final String xml = readFirstPartOfFile ( file ) ; return xml . indexOf ( "<" + tagName ) > - 1 ; }
Checks if the given file contains a start tag within the first 1024 bytes .