954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to create my own file format like .azw, .mobi,.epub etc. using java

Can anyone tell me about how to create my own format like .azw(kindle device format),.mobi,.epub etc..Is it possible to create it using java? if yes then what are the steps to do that? I am doing project for e-publishing company they need one own proprietary format like the above formats for their company. To accomplish this task, what are the things i have to learn or what details i have collect to do this?I planned to do this in java.Is it right platform to do that?

please help me and share your ideas..

Thanks in advance..

Venkat SM
Newbie Poster
3 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

AFAIK there is no magic in having a java program write out a file with any extension or contents.
The magic is getting a unique value for the extension and having the OS recognize it as belonging to your application. For example 12 years ago I used the RSS extension for my slideshow control file.
On MS windows, the connection between an extension and an application is via the registry.
On linux there is a table somewhere that needs to have an entry.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

Can anyone tell me about how to create my own format like .azw(kindle device format),.mobi,.epub etc..Is it possible to create it using java? if yes then what are the steps to do that? I am doing project for e-publishing company they need one own proprietary format like the above formats for their company. To accomplish this task, what are the things i have to learn or what details i have collect to do this?I planned to do this in java.Is it right platform to do that?

please help me and share your ideas..

Thanks in advance..


Hmm would this not depend on the type of OS such as Windows,Linix etc? Because I don't think java has an inbuilt file extension api. In windows one might use command prompt and regedit for example to make our application open a certain type of file ie *.cg

DavidKroukamp
Practically a Master Poster
Team Colleague
693 posts since Dec 2011
Reputation Points: 282
Solved Threads: 169
 

NormR1 is right, just creating a file with a certain extension can be done easily like

File myFile = new File("testfile.qrr");
boolean created = myFile.createNewFile();

but it would be nothing more than a txt file with a different extension. it'll take more than just to change the extension to make the data be stored or handled differently.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

Creating a file with your own format, and your own extension is easy.
In fact... You already know how to do that.
If the company you're dealing with has a proprietary format, only that company can tell you what the specification is.
If you're trying to output a file in a specific format, with a specific (usable) extension, that's another story.
If it is a "generic" format (which that company uses), you'll have to do a search for the format specification for the extension you wish to create.

hfx642
Posting Pro
515 posts since Nov 2009
Reputation Points: 248
Solved Threads: 105
 

Thanks for your great ideas....

Venkat SM
Newbie Poster
3 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 
Creating a file with your own format, and your own extension is easy. In fact... You already know how to do that. If the company you're dealing with has a proprietary format, only that company can tell you what the specification is. If you're trying to output a file in a specific format, with a specific (usable) extension, that's another story. If it is a "generic" format (which that company uses), you'll have to do a search for the format specification for the extension you wish to create.

Thanks for your reply

Venkat SM
Newbie Poster
3 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

i think it would be better if you have special algorithms to encrypt and decrypt the content of those files . So, it makes more confidential. Those files can not read by other applications such as notepad etc.

mhd_arif123
Newbie Poster
7 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

that doesn't really matter here.
when the contents is decrypted, the nature of the file itself doesn't really change. if it was created as a .txt with alternative file-extension, whether you encrypt the contents or not, the OS would still regard it as a txt file.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: