RE: Deleting files
RE: Deleting files
- Subject: RE: Deleting files
- From: "Jonathan Fleming" <email@hidden>
- Date: Thu, 16 Jan 2003 22:19:03 +0000
So Jim,
to clarify, if I want to delete an Object from the the EO that has the
fileName of the File/DIR in the System using a deleteMyFile() Method, would
I simply call the main Method in our example and pass myEOFileName into it
for deletion?:
public WOComponent deleteMyFile() {
EOEditingContext ec = tbJobItem.editingContext();
// delete tbJob from its editing context
ec.deleteObject(tbJobItem);
// remove object from relationship
tbClient.removeObjectFromBothSidesOfRelationshipWithKey(tbJobItem,
"tbJobs");
main (getMyEOFileName())//do I do this?
return null;
}
Jonathan
From: jim <email@hidden>
To: email@hidden
Subject: RE: Deleting files
Date: Thu, 16 Jan 2003 13:54:10 -0500
This works for directories as well as files.
import java.io.*;
public class Delete_the_Sucker{
public static void main (String filename) {
File file = new File (filename); // or directory
if (!file.delete()){
System.out.println(file.getName() +" cannot be delete");
}
}
}
If you have an instance of a file......then it contains a method delete()
to call to remove the file.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.