Class SpiderGitParser


  • @Deprecated
    public class SpiderGitParser
    extends SpiderParser
    Deprecated.
    (2.12.0) See the spider add-on in zap-extensions instead.
    The Class SpiderGitParser is used for parsing Git metadata from the .git/index file This parser currently supports Git internal index file versions 2,3, and 4. It does not currently support version 1, since this version is no longer supported. Version 1 appears to have disappeared with Git version 0.05 in 2005.
    • Constructor Detail

      • SpiderGitParser

        public SpiderGitParser​(SpiderParam params)
        Deprecated.
        Instantiates a new spider Git Index parser.
        Parameters:
        params - the params
        Throws:
        java.lang.NullPointerException - if params is null.
    • Method Detail

      • parseResource

        public boolean parseResource​(HttpMessage message,
                                     net.htmlparser.jericho.Source source,
                                     int depth)
        Deprecated.
        Description copied from class: SpiderParser
        Parses the resource. The HTTP message containing the request and the response is given. Also, if possible, a Jericho source with the Response Body is provided.

        When a link is encountered, implementations can use SpiderParser.processURL(HttpMessage, int, String, String) and SpiderParser.notifyListenersResourceFound(SpiderResourceFound) to announce the found URIs.

        The return value specifies whether the resource should be considered 'completely processed'/consumed and should be treated accordingly by subsequent parsers. For example, any parsers which are meant to be 'fall-back' parsers should skip messages already processed by other parsers.

        Specified by:
        parseResource in class SpiderParser
        Parameters:
        message - the full http message containing the request and the response
        source - a Jericho source with the Response Body from the HTTP message. This parameter can be null, in which case the parser implementation should ignore it.
        depth - the depth of this resource
        Returns:
        whether the resource is considered to be exhaustively processed
      • canParseResource

        public boolean canParseResource​(HttpMessage message,
                                        java.lang.String path,
                                        boolean wasAlreadyParsed)
        Deprecated.
        Description copied from class: SpiderParser
        Checks whether the parser should be called to parse the given HttpMessage.

        Based on the specifics of the HttpMessage and whether this message was already processed by another Parser, this method should decide whether the SpiderParser.parseResource(HttpMessage, Source, int) should be invoked.

        The wasAlreadyConsumed could be used by parsers which represent a 'fall-back' parser to check whether any other parser has processed the message before.

        Specified by:
        canParseResource in class SpiderParser
        Parameters:
        message - the full http message containing the request and the response
        path - the resource path, provided for convenience
        wasAlreadyParsed - if the resource was already parsed by another SpiderParser
        Returns:
        true, if the SpiderParser.parseResource(HttpMessage, Source, int) should be invoked.