Results 1 to 5 of 5
- 01-27-2013, 09:50 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 5
- Rep Power
- 0
How to create a completely new file?
Hi all,
Does anyone know how to create a totally brand new file.type that is only readable by a specific Java program?
For example:
Microsoft word can read .docx files (sure there are others).
Microsoft word cannot read .3dsm (not sure what file type 3dsmax uses, but Word can't read it).
What I want:
My Java Program can read .xxx files. Since .xxx will have a unique storing format,
No other Program can read .xxx files.
So my question is, how can I create a totally new kind of file, and how do I program it in java.
I googled it, but I only find how to make .txt files which is not what I want.
Please don't ask what I'm making, I'm just trying to learn for a future big project.
Thanks in advance!
- 01-27-2013, 10:53 PM #2
Senior Member
- Join Date
- Jan 2011
- Location
- Belgrade, Serbia
- Posts
- 227
- Rep Power
- 3
Re: How to create a completely new file?
Try to use that example you have from Google. Just change your extension form .txt to .xxx inside your code..
-
Re: How to create a completely new file?
Well sort of. If the example in Google writes to a text file, then no matter what you change the extension to, it will still be a text file. The key will be to not write out text or chars with a Writer or PrintStream but rather to write bits and bytes in some way that makes sense to you where you can reverse the process and read in the data. You will likely need to create some type of file header that holds the "meta" information of the file and have this filed by the file data itself. Another option is to encrypt the file.
- 01-27-2013, 11:24 PM #4
Member
- Join Date
- Jan 2013
- Posts
- 5
- Rep Power
- 0
Re: How to create a completely new file?
Agreed, renaming a text file is still a text filed. I think encrypting is the way to go.
Another approach I could do is some kind of library of items, where the items are locked up, and the only way to access the library is through the program. However, this would require a creating of the library as a folder. I want to make a program that can store images, but I want the images to be protected so that no one edits them, so if I could make a library that store's the images data, but additionally requires some string or code to access it, then that should also do the trick.
Still though, does anyone have any idea how to make one? Not entirely sure if its doable via java, but since java directs data then why not? >.>
- 01-27-2013, 11:24 PM #5
Senior Member
- Join Date
- Jan 2011
- Location
- Belgrade, Serbia
- Posts
- 227
- Rep Power
- 3
Similar Threads
-
Help plz: not completely working JAR
By linkingabo in forum NetBeansReplies: 6Last Post: 01-28-2012, 04:32 AM -
completely new
By battosai16 in forum New To JavaReplies: 1Last Post: 08-05-2010, 07:43 PM -
pack200 .gz file unpack and create .jar file in browser(speed test).
By maheshsardar in forum Java AppletsReplies: 1Last Post: 08-04-2010, 03:24 PM -
Need to create the archieved file for all generated log file using log4j
By ashu_knw in forum New To JavaReplies: 1Last Post: 03-31-2010, 08:04 PM -
I am completely stuck
By jpnym15 in forum New To JavaReplies: 2Last Post: 11-14-2007, 06:40 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks