Forum Stats

  • 3,874,298 Users
  • 2,266,718 Discussions
  • 7,911,809 Comments

Discussions

How to write an application with its own filetype?

843810
843810 Member Posts: 46,938
edited Feb 2, 2010 5:50AM in Java Desktop Applications
How can i create a filetype for my application? I mean my program 's data will save in a file that can only read/update/edit data by my program; and i can open this file in another computer that already install my application, too.

Comments

  • User_64CKJ
    User_64CKJ Member Posts: 7,279 Silver Badge
    Java4ever2010 wrote:
    How can i create a filetype for my application? I mean my program 's data will save in a file that can only read/update/edit data by my program;
    One solution is to (launch the application using webstart &) store the data using the PersistenceService. The PS is only intended for relatively small amounts of data. Here is a [demo of the PS|http://pscode.org/jws/api.html#ps] *(<- link).*
    ..and i can open this file in another computer that already install my application, too.
    If you want to add that ability, it would be necessary to offer a menu item or button to 'Export' the data held in the PersistenceService, to something a file that can be moved at the user's choice.
  • 843810
    843810 Member Posts: 46,938
    You can also write any format manually that you choose, just don't conform to any standard format and you'll have a custom format. Please note, almost any file can be read, but making sense of the data is quite another matter. If you want the data to be private, then you'll need some type of encryption for the data.
  • 843810
    843810 Member Posts: 46,938
    Ok, so my problem can be solved by java.io and encrytion?
    Thks very much. I will study on this. ^^
  • gumuruh
    gumuruh Member Posts: 98
    Java4ever2010 wrote:
    How can i create a filetype for my application? I mean my program 's data will save in a file that can only read/update/edit data by my program; and i can open this file in another computer that already install my application, too.
    how about save it via File object as usual, but you made it as a byte values...
    so then the computer won't show it as usual text ... :D

    ... but encryption? do u need it as well?
This discussion has been closed.