• 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: 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.

  • Follow-Ups:
    • Re: Deleting files
      • From: Petite Abeille <email@hidden>
    • Re: Deleting files
      • From: jim <email@hidden>
  • Prev by Date: Re: File System - Adding and Deleting files/DIR's In Web Server Resources
  • Next by Date: Re: Deleting files
  • Previous by thread: RE: Deleting files
  • Next by thread: Re: Deleting files
  • Index(es):
    • Date
    • Thread