net.sf.uadetector.datareader
Interface DataReader

All Known Implementing Classes:
XmlDataReader

public interface DataReader

Interface for data readers that reads User-Agent informations for implementations of UserAgentStringParser.

Author:
André Rouél

Method Summary
 Data read(java.lang.String data)
          Reads UAS data from the given String.
 Data read(java.net.URL url, java.nio.charset.Charset charset)
          Reads UAS data from the given URL.
 

Method Detail

read

Data read(java.net.URL url,
          java.nio.charset.Charset charset)
Reads UAS data from the given URL.

The implementing class must ensure that no error leads to a termination of this operation. In case of an error this operation must return Data.EMPTY and all error information must be stored in a log.

Parameters:
url - the URL where the UAS data can be retrieved
charset - the character set in which the data should be read
Returns:
read in UAS data as new Data instance or Data.EMPTY

read

Data read(java.lang.String data)
Reads UAS data from the given String.

The implementing class must ensure that no error leads to a termination of this operation. In case of an error this operation must return Data.EMPTY and all error information must be stored in a log.

Parameters:
data - a string of UAS data
Returns:
read in UAS data as new Data instance or Data.EMPTY


Copyright © 2011-2014. All Rights Reserved.