Need Help With Java Filesystem and GetDown Please

Started by dangerdoc, February 22, 2012, 16:24:46

Previous topic - Next topic

dangerdoc

In lwjgl, I am programming a game for pc. I am using GetDown to manage the data. How do I put the files in appdata using GetDown? Does Java Filesystem work in relation to the .jar using it? For instance, if I have a jar at C:/program files/java.jar, specifying images/image.jpeg will point to C:/program files/images/image.jpeg?
Can you also use ../image.jpeg to get C:/image.jpeg? Is there a path to specify for appdata, like %appdata%?

Please help me!
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

kappa

You need to put your images inside a jar file (they are just zip files), and then load it from Java using an InputStream instead of a FileSystem File. Basically the same as you do when using an Applet or Java Web Start.

dangerdoc

My question was really an abstract question about managing files outside the jar that need to be changes frequently (example, save files?) About GetDown, How does it know where to put the files for each OS? After it installs the files, how do you tell the app it's location in the FS? Can you specify "../" to get to the .jar's parent folder? Also, I don't understand how you make a program that uses getdown to download/install/update an app. I read the wiki, and OOO labs, but I didn't get it. Could you just tell me how to make a small program that downloads, installs, and launches my app?

Thanks,
dangerdoc
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

dangerdoc

Let me narrow down the question since nobody answered yet. If I have a .jar somewhere in the computer, how do you access files without knowing the .jar's directory? This may be a simple question, but I don't know much about java file management.

Thanks,
dangerdoc
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

kappa

GetDown will automatically add the jar to the java classpath, so all you need to do is call an inputstream to the file in the jar that you want to get.

dangerdoc

Is there a way to put files into the .jar while it is running? I really wanted to know how to access saved games while the program is running.
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla