0

I am working with a Java Application. In this, I must copy a file from source to Multiple Destinations. The destinations are various USB drives. (ie) I'm copying a file for desktop and sending to a number of USB drives. Here, my problem is, I am sending files to all USB drives I attached, now I need to make the files UN-deletable. The undeletable process will be done in a single event. For example once I click the ok button, the Files, which are present in all USB drives are made undeletable. Any idea how to do this.

gprathour
  • 14,813
  • 5
  • 66
  • 90
Aerrow
  • 12,086
  • 10
  • 56
  • 90
  • 1
    This [answer](http://stackoverflow.com/questions/7282901/undeletable-folder-in-java) may help you for creating un-deletable folders and files. –  Nov 25 '11 at 12:48

2 Answers2

2

When copying source file to other files, put the destination File objects in a collection. Then, in the event handler for your 'set read only' button, loop over that collection and call setReadOnly() on each File.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
socha23
  • 10,171
  • 2
  • 28
  • 25
0

not very sure I understand your question correctly.

maybe you can store the directories and when you click the OK button, you iterate these directories and set them to undeletable one by one?

xorange
  • 191
  • 1
  • 10