mibble-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mibble-users] Loading MIB files that are in a jar


From: Per Cederberg
Subject: Re: [Mibble-users] Loading MIB files that are in a jar
Date: Sat, 19 May 2007 13:55:00 +0200
User-agent: Thunderbird 2.0.0.0 (Macintosh/20070326)

Close, but not quite the correct way to do it.
Here is how:

1. Make sure that your jar-file is in the
   CLASSPATH of your application.

2. Inside the jar-file, place the MIB files
   inside an appropriate subdirectory, such
   as "myapp/MY-APP-MIB".

3. Call "addResourceDir("myapp").

4. Violá. You should now be able to just call
   load("MY-APP-MIB").

Please note that since the CLASSPATH content
cannot be easily listed from some nice Java
API, all the MIB files loaded in this way must
have standardized names. I.e. the file names
inside the jar-file should be just <mibname>
without any file extension or similar. Casing
is important.

Have a look at the included mibble-mibs.jar
if you need more help.

Cheers,

/Per

Nigel Birch wrote:
Hi,

I have been using Mibble in a custom SNMP Manager application, and loading device-specific MIB files as text files in the file system. Works great.

But now I need to package device specific MIB files in a jar, and distribute that with the application.

Looking at the MibLoader API, I’m assuming I need to do the following:

1 – call addResourceDir() with the full path of the directory in which the mib jar is located.

2 – call load() with the name of a MIB file ****with****in** the jar.

I am doing this, but I always get a “FileNotFound” exception.

Does anyone have experience with loading MIB files in a jar?

Thanks

NCB


------------------------------------------------------------------------

_______________________________________________
Mibble-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/mibble-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]