Incorporating data files into packages and accessing internally



Hello,

I hope that I am not posting to an inappropriate group with these
questions. If I am and you have the name of another more appropriate
group, please let me know of that group and I will repost.

Anyway, I have developed a small Mercator projection class. I also
have data files with coastal data so that I can get a pretty little
map of the Earth.

What I want to do is include the coastal data files into the package
that I have my Earth class in, so that when I jar up the whole thing,
the data is included with the jar. Do I just create a folder within
my structure that holds the data files and then jar in the normal
manner? (BTW, I am using NetBeans).

Furthermore, I would like to be able to open and read the contents of
the data files within the package without having to know its path on
the disk. I would like to think that I can access a data file within
a package in a manner similar to accessing another class in the
package. If so, how do I do this?

I have played with this for several hours with no luck, so I
appreciate any help that you may have.

Todd

.



Relevant Pages

  • Re: Incorporating data files into packages and accessing internally
    ... the data files within the package without having to know its path on ... put the data in resource, usually gzipped in the jar. ... massage the data so it looks like java source code, ...
    (comp.lang.java.programmer)
  • Re: Data as Scripts and [package require]
    ... % package require -exact simulator 2.0 ... IMHO data files should contain data, ... Process the file by some common routine until the `version' is known, ...
    (comp.lang.tcl)
  • RE: word 2007 wont reg key
    ... number on the installation disk included in the package of items with the ... but when i copied some old data files into word 2007 ... able to get automatic window updates though. ...
    (microsoft.public.word.docmanagement)
  • Re: Incorporating data files into packages and accessing internally
    ... the data files within the package without having to know its path on ... When your data is located inside the jar that also contains your ... a package in a manner similar to accessing another class in the ...
    (comp.lang.java.programmer)
  • Packaging Tcl/Tk Application on Windows: Single File Executable
    ... I need to package application developed in Tcl/Tk on Windows. ... be a single file executable with all data files, dependency ... There should be not reference to external data files such as images .. ... All should be bundled as a single file on desktop. ...
    (comp.lang.tcl)