0

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?

dazito
  • 7,740
  • 15
  • 75
  • 117

1 Answers1

1

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.

Caleryn
  • 1,084
  • 3
  • 18
  • 23
  • So that means I've to download the source code, edit the agent.properties file and generate the .jar file? – dazito May 08 '14 at 10:17
  • 1
    Extract it from the jar file you have (zip enconding) edit it and put it back again at it's most simple. (but keep an edited copy so you don't need to do that edit again if you upgrade the lib). – Caleryn May 08 '14 at 10:22