Creating immutable data file in Java

I am currently writing a program that takes user input and creates .csv comma delimited file lines. I need a way to save this data so that users cannot easily edit this data. It does not have to be super safe, enough that it cannot be accidentally edited. I also need another file (or the same file?), Which was then easily accessible (in the file system) by the user, then to send this file to the system administrator, who can then open the CSV file. I could provide this second person with a conversion program, if necessary.

The file to which I save the data and the file to be sent can be two different files if there are any advantages to this. I am currently considering using a file with a strange file extension, but I save it as a text file so that the user can open it only if he knows it. Another option is a kind of encryption, but I'm not sure if this is necessary, and even if I started.

Thanks for the help:)

Edit: This file is intended to store actual input. Currently, data is collected on paper forms, which are then sent to the administrator to manually enter all the data. This small application is intended for someone else to enter data from a paper form and then tell them if they entered everything correctly. After they have entered everything, they should send data to the administrator. It would be preferable if the sending was processed automatically, but this application should be very simple and low, and I do not want the Internet connection to be necessary.

+3
source share
5 answers

, , - , , . , , , , . , , , -. , , , , .

+1

ZIP () " " (CSV, XML, ..) , , .

/: ZIP ( ) , // / . , , . .

ZIP ( CAB):

  • ( )
  • " " (, XML)
  • " "
  • ( !)

, -ZIP , ( , , , ZIP " " ) ZIP . Microsoft , CAB ( ZIP) . , ".XSN" ".WSP" ".gadget" , 7-zip, , , , "". , ".WAR" ".JAR" , Java, .

ZIP , - , . , (, "" ), . "" /, , , , . , - " ", ZIP ( ) , /.

.

+1

, ?

0

, , Windows ( , XP x64 Windows 7), , , , :

, , , "data.csv", "data.csv: 42" . ( , "data.csv: 42"!= "Data.csv: carrots"!= "second.csv:. " )

, , 0 . "", , , , : 42, , , , "data.csv: 42" . !

. "data.csv", . , , , , - csv, :

, , .

0
source

Source: https://habr.com/ru/post/1779317/


All Articles