Package fr.yunes

Class AccessEntry


  • public class AccessEntry
    extends java.lang.Object
    The AccessEntry class represents entries of Apache access.log files. This is a primitive implementation of what is expected. Thus, this is not for real life usage, only for training purpose.
    Version:
    1.0
    Author:
    yunes
    • Constructor Detail

      • AccessEntry

        public AccessEntry​(java.lang.String line)
        Constructs a new AccessEntry from a given String. Strings must roughly be in Apache custom log format, i.e.:
        109.184.11.34 - - [12/Dec/2015:18:32:56 +0100] "GET /administrator/ HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0" "-"
        If the string can't be parsed, the object is in incorrect state and the string is stored in the text property.
        Parameters:
        line - the string to be parsed.
    • Method Detail

      • getProto

        public java.lang.String getProto()
      • getCode

        public int getCode()
      • getRequest

        public java.lang.String getRequest()
      • getURL

        public java.lang.String getURL()
      • isCorrect

        public boolean isCorrect()
      • getUserAgent

        public UserAgent getUserAgent()
      • getDate

        public java.time.ZonedDateTime getDate()
      • getLength

        public int getLength()
      • getText

        public java.lang.String getText()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object