RadiusDictionary

From JRadius

Jump to: navigation, search

The RadiusDictionary program generates JRadius RADIUS attribute Java class source files. These classes are then compiled and packaged to form the JRadius dictionary jar file. A default JRadius dictionary jar is provided with the binary distribution, however, this program can also be used to generate your own dictionary based on your existing FreeRADIUS dictionary files. RadiusDictionary is licensed under the Gnu Public License (GPL).

java -classpath jradius.jar net.sf.jradius.freeradius.RadiusDictionary

Without any arguments (like above), RadiusDictionary displays the following usage help:

Requires 3 arguments: [package-name] [dictionary-dir] [java-src-dir]
       package-name:    Name of the Java package to be built (e.g. net.sf.jradius.dictionary)
       dictionary-dir:  Directory where the FreeRADIUS 'dictionary' file is
       java-src-dir:    Directory where to write Java classes

To rebuild the JRadius dictionary jar from the JRadius binary distribution root directory (see Getting started), the following commands can be used:

 unzip freeradius.zip
 mkdir src build
 java -classpath jradius.jar net.sf.jradius.freeradius.RadiusDictionary \
     net.sf.jradius.dictionary freeradius/dict src
 javac -classpath jradius.jar:lib -d build `find src/ -name '*.java'`
 jar cvf jradius-dictionary.jar -C build .

Building using ant (taken from build.xml):

 <target name="dictionary" depends="compile-base" unless="have.dictionary"
         description="Create the JRadius Dictionary Library">
 
   <mkdir dir="${dict.javadir}" />
   <mkdir dir="${dir.build}/dictionary" />
   <mkdir dir="${dir.dist}" />
 
   <java fork="false"
         classname="net.sf.jradius.freeradius.RadiusDictionary"
         failonerror="true"> 
 
     <classpath>
       <path refid="build.classpath"/>
       <pathelement path="${dir.build}/jradius"/>
     </classpath>
 
     <arg value="${dict.package}"/>
     <arg value="${dict.dictdir}"/>
     <arg value="${dict.javadir}"/>

   </java>
 
   <javac debug="${compile.debug}" deprecation="${compile.deprecation}"
          target="1.4" source="1.4" optimize="on" destdir="${dir.build}/dictionary"> 
 
     <classpath>
       <path refid="build.classpath"/>
     </classpath>
 
     <src path="${dict.javadir}"/>

   </javac>

   <jar jarfile="${dir.dist}/jradius-dictionary.jar"
        basedir="${dir.build}/dictionary" includes="**/*.class"/>

 </target>
Personal tools