instance a jar file

hello!

i want to use snark http://www.threerings.net/code/snark/

inside my application.

the only help text says:

"How do I use it?

Simply add snark.jar to your classpath and instance Snark for each file you wish to download."

what does that mean? how do use that jar? how can i "instance" something from within my app? i cannnot make a new objekt new Snark()..

please help!

[422 byte] By [anti43a] at [2007-11-27 8:55:13]
# 1

I'm assuming they have some documentation of their site that tells you what classes are included in the library. After you include the jar on your classpath, you can just create an object that's part of the library, just like you do with the classes that come with the standard java library.

SomeSnarkClass ssc = new SomeSnarkClass();

hunter9000a at 2007-7-12 21:16:01 > top of Java-index,Java Essentials,Java Programming...
# 2
the snark class has no constructor, just a main method-- how do i handle such jars?
anti43a at 2007-7-12 21:16:01 > top of Java-index,Java Essentials,Java Programming...
# 3
Every class has at least one constructor! It may be that1. You aren't looking in the right place.2. The Snark class has no *public* constructor because it relies on a factory or a factory method. Perhaps the class has a static method like getInstance.
BigDaddyLoveHandlesa at 2007-7-12 21:16:01 > top of Java-index,Java Essentials,Java Programming...
# 4
See http://www.threerings.net/code/getdown/docs/api/
cotton.ma at 2007-7-12 21:16:01 > top of Java-index,Java Essentials,Java Programming...
# 5

hello!

at first place:

getdown != snark. there is no api for snark at their site.

next:

it was pretty simple, i only got to call

Snark.main(args) from the main snark class.

without a snark object or something. thats the point- it is clear how to do after youve done it once. but i never called a class this way. now i know :-)

however i wanna thank you for your help!!

anti43a at 2007-7-12 21:16:01 > top of Java-index,Java Essentials,Java Programming...