• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Deleting files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting files


  • Subject: Re: Deleting files
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Fri, 17 Jan 2003 01:06:24 +0000

OK, Jim
I understand that, now I'm going to go one step further; what would I need to do if in the EOModel I want to delete an object that has the cascade option set? Eg. I have these entities,
Client <oneToMany>> Job <oneToMany>> JobPicture
if I delete a Job all the JobPicture fileNames will be deleted, how will I then delete the directory in the file system that holds all the images that the JobPicture's FileName attribute/property pointed to?







From: jim <email@hidden>
To: "Jonathan Fleming" <email@hidden>
CC: email@hidden
Subject: Re: Deleting files
Date: Thu, 16 Jan 2003 17:50:53 -0500

I would try my changes below.

import java.util.*;
public WOComponent deleteMyFile() {
	// I added
	File file = new File(getMyEOFileName());

       EOEditingContext ec = tbJobItem.editingContext();
       // delete tbJob from its editing context
       ec.deleteObject(tbJobItem);
       // remove object from relationship
       tbClient.removeObjectFromBothSidesOfRelationshipWithKey(tbJobItem,
                                                               "tbJobs");
	//I added
	file.delete();


return null; }


_________________________________________________________________
MSN 8: advanced junk mail protection and 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.

  • Follow-Ups:
    • Re: Deleting files
      • From: Art Isbell <email@hidden>
  • Prev by Date: Re: Deleting files
  • Next by Date: Re: Deleting files
  • Previous by thread: Re: Deleting files
  • Next by thread: Re: Deleting files
  • Index(es):
    • Date
    • Thread