Search code examples
librariesrestletjavarestlet-2.0

Restlet framework - Edit agent.properties file


I'm using the ClientInfo class from RESTlet to get the user agent from the browser used by the client.

It works fine but it is kind of out-dated (the new Opera is detected as Chrome, and so on...) so I want manually insert my templates to the agent.properties file. The problem is I don't know where the agent.properties file is. I just have the jar file from RESTlet.

From the link above, it says:

Restlet users has the ability to define their own way to extract data from the "user-agent" header. It is based on a list of templates declared in a file called "agent.properties" and located in the classpath in the sub directory "org/restlet/data".

Anyone knows where is that agent.properties file?


Solution

  • It is in the core restlet library jar (org.restlet) at version 2.2, Sitting in the same package as the ClientInfo class. I have not checked back to 2.0 but I suspect that it remains there.

    the github location for the master copy is currently at https://github.com/restlet/restlet-framework-java/blob/master/modules/org.restlet/src/org/restlet/data/agent.properties and I'm sure that a patch to deal with upgraded browser versions, could be welcomed.