0

I have a swing application that uses many data files, these data files will change time to time. How can I load these data files on client's machine? Is there any way to create a folder like structure and run a batch file or so? Any help is appreciated.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Bala
  • 1,295
  • 1
  • 12
  • 23
  • *"many data files"* What types of files are they? What data do they contain? Are they strictly for read only (on the client-side)? Are they consumed by other apps. besides yours? – Andrew Thompson Jan 24 '13 at 22:30

1 Answers1

1

There are several ways to do this:

  1. Assume you want to ship your application with the datafiles, you may embed them as a zip/jar in your application-jar-file.

    Extract the embedded zip to a temporary local file and use ZipFileSystemProvider to extract the content to some place on the disc.

    Here is an example how to extract some content from zip/jar-file embedded in a .jar-file downloaded by JWS.

  2. Same as 1, but skip the zip stuff and instead provide a list of all the resources you want to extract

  3. One other way is to create the files pragmatically using either java.nio.file (java 7+) or java.io.File

Community
  • 1
  • 1
Aksel Willgert
  • 11,367
  • 5
  • 53
  • 74
  • Thanks for the help. All the data files are in csv format. As of now, there is no restriction on data files. I will try the solution you have suggested. – Bala Jan 25 '13 at 12:02