Can not delete directory structure

Hello,
i have tryed very much but no luch. i want to delete directory structory. directory may contain n no of files and n no of sub directories.
Please help me to correct this code. please give me solution it is very nessary in my project.
Veru much thans in advance
My code
private boolean deleteDomainStructure(File dir){
          if (dir.isDirectory()) {
     String[] children = dir.list();
     for (int i=0; i<children.length; i++) {
          boolean success = deleteDomainStructure(new File(dir, children));
     if (!success) {
     return true;
     return dir.delete();

Oh,
Okey, would you tell me how can i create directory with read only property off.
when i create a dir with File f = new File(path); file.mkdir(); it create a dir with read only.

Similar Messages

  • Can not delete encrypted message in outlook 2013

    I have outlook 2013 connected to our internal exchange server 2013. We have Microsoft Certificate Authority (Active Directory Certificate Service) Server in our company. All users have User Certificate for sign and encrypt email. I received many encrypted
    message from other user in my company but I can not delete these message. when I was try to delete these message I receive "Unknown Error".

    Hi,
    For Encrypted emails, try Shift+Delete and choose Yes.
    Regards,
    Melon Chen
    TechNet Community Support

  • I can not delete an email I get a message218130.emlx" couldn't be copied because you don't have permission to access "Messages"

    I can not delete an email I get a message218130.emlx” couldn’t be copied because you don’t have permission to access “Messages”

    Actually, the Finder solution did not work for me, but here's what did:
    Quit Mail (for safety's sake).
    Open Terminal (it's in Utilities folder usually, but since I updated to ML it's in a folder called Other for some reason)
    Once Terminal is open, you'll want to login as ROOT.  You do this as follows:
    Type
    sudo -i
    Then hit Enter/Return. You'll be promoted for your system password. Hopefully you'll remember it. Enter your password then hit Enter/Return.
    You'll then be at what's known as a root prompt.
    At this point BE VERY CAREFUL.  You have the ability at this point to completely destroy your machine beyond repair. Only type what I list below:
    To find the folder that contains the email message you'll need to type the following:
    find . -name "218130.emlx"
    Hit Enter/Return
    This will take a minute or two but what should appear in the list of other items that appear is something along the lines of the following (it won't be exactly this but will look LIKE this) I've replaced some personally identifying info:
    ./Users/yourname/Library/Mail/V2/POP-youremailaddress@yourmailserver/INBOX.mbox/ 0355DF0D-5E99-4798-B79E-48D71E68AF34/Data/3/2/Messages/23219.emlx
    This line describes the location of the offending email. You know what to put yourself into this directory:
    cd /Users/yourname/Library/Mail/V2/POP-youremailaddress@yourmailserver/INBOX.mbox/0 355DF0D-5E99-4798-B79E-48D71E68AF34/Data/3/2/Messages/
    Hit Enter/Return
    Notice, I left of the name of the actual email address. You'll need to be sure you type the location EXACTLY or this won't work. You want to be in the Messages folder. You'll know you're there because your Terminal prompt will look something like this:
    Your Name - iMac:Messages
    Then just to be sure you're in the right place, type
    ls
    Hit Enter/Return
    You should then see something like this:
    iMac:Messages root# ls
    23013.emlx    23096.emlx    23100.emlx    23156.emlx    23210.emlx    23213.emlx    218130.emlx
    You'll see the offending message. Now, you delete ONLY this message. Type:
    rm -f 218130.emlx
    That's RM at the start above. You'll need to type it in lower case. Be sure that's all you type.
    Hit Enter/Return
    You'll should be disappointed at the results because it will look like nothing happened. You can hit ls  and Enter/Return one more time and the offending file should be gone.
    EXIT TERMINAL. DO NOT TYPE ANYTHING ELSE. DO NOT "POKE AROUND". THIS IS NOT THE PLACE TO EXPLORE. SERIOUS SYSTEM DAMAGE CAN BE CAUSED FROM HERE. EXIT TERMINAL NOW.
    Now re-open Mail  - the message will still appear to be in there, but magically, you can delete it. you can also delete it from your Trash for good measure.

  • Can not delete users

    Logged in as the administrator, I still can not delete users. I click the '-' button, it asks to confirm and nothing happens. It's that simple. OS X Server V4.0.3. Run disk permissions verify/repair several times, no joy.
    Any suggestions?

    Could it be that you're logged in with an account with system administrator privileges but not Open Directory administrator privleges (the difference was more obvious in the old server admin app than the new one from MOS 10.7 + Server 1 and up)?

  • Can not delete and modify events

    Sun Java System Calendar Server 6 2005Q4 (built Jul 21 2005)
    I have created a new event in my calendar but I can not delete and modify event.
    Everyone on this system have same problem.
    How do I do ?
    Regards,
    JO.

    I did not see any errors in log directory.
    # showrev -p | grep ics5
    Patch: 116577-24 Obsoletes: 117706-08 Requires: Incompatibles: Packages: SUNWics5, SUNWica5
    Patch: 117860-16 Obsoletes: Requires: Incompatibles: Packages: SUNWics5, SUNWica5
    Patch: 118186-16 Obsoletes: Requires: Incompatibles: Packages: SUNWics5, SUNWica5
    # ./csdb check
    Checking the database health condition.
    Please be patient, this may take a while...
    Start by scanning components db...
    Scanning events database...
    102 events scanned
    102 events copied
    Scanning todos database...
    10 todos scanned
    10 todos copied
    Scanning deletelog database...
    14 deletelog entries scanned
    Scanning gse database...
    0 gse entries scanned
    Scanning recurring database...
    0 recurring entries scanned
    Successful components db scan
    Now starting calprops db scan...
    Scanning calprops database to uncover events...
    326 calendars scanned
    Scanning calprops database to uncover todos...
    finished...
    Calendar database consistency check completed successfully
    Regards,
    JO.

  • Can not delete file with illegal character

    have a file with name of e}ail.txt
    can not delete it. Tried e*.txt, did not work.
    removed everything from the directory , renamed the directory to badDirectory , tried rm badDirectory /s /q
    and that didn't work.
    dir /X did not report an 8.3 file name.
    can not delete file or directory from FileManager either.
    went to a Linux box and did an smbfs mount. Still can not delete file.
    So, how does one delete a file with a openface curly bracket in the name?
    TechNet

    odder and odder:
    R:\rem>move badDirectory \junk\
    1 dir(s) moved.
    R:\rem>cd \junk
    R:\junk>rd \\.\r:\junk\badDirectory
    The directory is not empty.
    R:\junk>rd \\.\r:\junk\badDirectory /s /q
    \\.\r:\junk\badDirectory\e}ail.txt - The system cannot find the file specified.
    \\.\r:\junk\badDirectory\email.txt.bak - The system cannot find the file specified.
    R:\junk>dir badDirectory
    in drive R is f drive
    Serial Number is 58E7-B426
    Directory of R:\junk\badDirectory
    12/17/2014 02:41 PM <dir> .
    12/17/2014 02:41 PM <dir> ..
    08/30/2012 08:54 AM 68,719,477,275 e}ail.txt
    10/05/2011 11:11 AM 488 email.txt.bak
    2 File(s) 68,719,477,763 bytes
    2 Dir(s) 2,236,207,104 bytes free
    </dir></dir>
    The file e}mail.txt is not nearly that large, more like the size of the bak file. And when I try to use character completion type e} I get type e}badDirectory
    TechNet

  • Can not delete Twitter mentions from the Hub

    Can not delete Twitter mentions from the Hub. When I delete, they reappear in a few minutes.

    I had the same problem,so i just deleted Twitter altogethet. Like was said before it must be bug among many they seem to have,including password compromises

  • IPhone 5 can not delete emails. Will not move to trash folder or empty trash

    iPhone 5, I can get mai. I can send mail. I can not delete mail. If i click to send the read mail to trash folder... error ca not move mail to trash folder.
    I can move read mail to the trash folder, but can not empty the folder...
    HELP

    Read this thread https://discussions.apple.com/message/5616151#5616151

  • Epub books show up in ipad on itunes but do not show up on ipad. Also can not delete the books from ipad in itunes

    epub books show up in ipad on itunes but do not show up on ipad. Also can not delete the books from ipad in itunes

    You have no choice but to lose your data back to the last backup you made.
    Here's how to do the recovery.  Note you may have to try to get into recovery mode more than once to succeed:
    HT1808
    I'm sure next time, you'll be more vigilant about keeping current backups.

  • Can not delete files from Adobe reader

    can not delete files from adobe reader.

    Can you let us know a little more about what you are trying to do? Adobe Reader opens pdf files but does not store them so, there's nothing to delete.

  • I can not delete bookmarks from the bar as I am spammed with many bookmarks.

    On my bookmark bar I have multiple instances of "Webmail Notifier" and they are in my bookmark list in many places. I am unable to delete them at all. How can I fix this issue?
    I have many bookmarked items that I do not want to lose as well.

    I did that and the links disappeared. The problem that I have now is:
    I now have 7 empty folders that I am unable to remove on my bookmark bar.
    I have many empty folders in my bookmarks that I am unable to remove as well.
    I can not move them, I can not delete them.
    I am attempting to include a snapshot so you can see.

  • HT4847 I can not delete old icloud back up from my old phone, keep receiving an error message "this back up can not be deleted because it's in use" it is not in use that phone is long gone!

    I can not delete old icloud back up from my old phone, keep receiving an error message "this back up can not be deleted because it's in use" it is not in use that phone is long gone!

    I have the same problem here and it wont let me do another back up or delete the old one.... Please help!!!! Anyone

  • I can not delete my history and adding new bookmarks. Upgrading to later Firefox versions and/or re-installing didn't help. The address bar still shows the web addresses of old and whenever I make new bookmarks, it's always gone as if it was never made.

    I can not delete my history and adding new bookmarks.
    Upgrading to later Firefox versions and/or re-installing didn't rectify it either.
    The address bar still shows the web addresses of old and whenever I make new bookmarks, it's always gone as if it was never made.
    Also, I have noticed that every once in awhile you can not close tabs you've opened, either by pushing on the X button and/or clicking on the mouse to close it. Although closing the window and opening it again (without closing the Firefox application) seemed to rectify the problem in the short term, it's becoming quite annoying.
    == This happened ==
    Every time Firefox opened
    == the Firefox is being used

    I think I have a solution.
    First, download the add-on SQManager. This should be included with FireFox, it is really good.
    Look for the file '''moz_hosts''' in the folder '''places.sqlite'''.
    Don't delete the file, just delete the information in the file. My file has over 3600 websites, which go back years!! I did not know they were there, but I was frustrated about not being able to get rid of them. They popped up every time I used the address bar. Clearing my history would not get rid of them.
    This is where they are stored!! I found that by deleting the pesky web site from '''moz_hosts''', it does not appear in my address bar anymore!!!
    I think that if I just delete all the websites in moz_hosts....
    Wa-la...History Gone!!!
    As long as you don't delete the file, just empty it, FireFox won't know the difference. It will just keep adding websites to it until you empty it again.
    Why running "clear recent history" doesn't do this, I don't know. You are doing manually what "clear recent history" is not doing.
    Please tell me if you see any flaw in this.
    ''I think it's the solution we've all been looking for!''

  • Can not delete photos or albums sync from computer to iphone 4s

    I can not delete photos or albums that were sync from computer to iphone 4s. I tap edit but there is no delete icon. Help. This is my first iphone

    You delete them the same way you put them there, the sync process.
    Deselect the folder in itunes and sync.

  • I Can not delete appointment made in Outllook in my Iphone

    Hello,
    I Can not delete appointment made in Outllook and sync in my Iphone (using Exchange Sync).
    I can only delete this appointment in my Outlook and then they will be deleted in my Iphone.
    Strange situation?
    I should be able to create, postpone, delete ....any appointment made from the iphone or from Outlook?
    Why can I ?
    What is the purpose then to have it sync?
    if you can only dothe change on one side and then sync to have it mirored in Iphone
    Any clue?
    Other question: in my Outlook I have several calendar. When I choose to sync calendars in my iphone, color are picked random. Why can't I choose the color i want in my iphone (why if i want the personal calendar to be green instead of orange? )
    Thanks
    Message was edited by: bruxelles5
    Message was edited by: bruxelles5

    OK regarding the color of the calendar.
    A little trick.
    I create as much calendar in Outlook, and then sync with the Iphone (trough Exchange)until the color I wanted show up.
    example I wanted the Personal calendar to be GREEN
    After test1 + test2 + test3 ........on test5 calendar the color was green.
    I then deleted the other calendar not needed.
    And the test5 colored green was still in place.
    I then rename this calendar to Personal.
    And voila

Maybe you are looking for

  • ITunes in Windows is horrendous

    Is there ever likely to be a day that Apple gets iTunes in windows right? I spent 1.5 hours last night trying to add a new movie to my daughters ipod touch... 1. the application is a memory hog and takes 2+ minutes to fully load 2. Switching between

  • TS4036 I received a message this morning to download new software on my IPhone. I did so but all my contacts were lost! I did not know I was supposed to have backed them up on ICloud

    I downloaded the new apple software and it lost all of my contacts! I am a senior citizen and didn't know I was supposed to download everything to ICloud. Can someone help me restore all of my phone numbers? Oddly, the recently used numbers are there

  • How to start with JDeveloper?

    As a straight A student of Computer Science, I put my hands on database development of an information system project for our CS faculty this summer. JDeveloper is used as the IDE for such project. I have learnt Java 2 and something about Oracle datab

  • Ant to delete JMS Server

              I am trying to use an Ant script to configure a new domain for weblogic server           8.1           Ideally I want to run the script and have it configure all resources I will need           (jdbc, jms, etc.). Currently I am having issue

  • Getting a video clip onto my iPod

    I am having a bit of trouble transferring a video clip from a folder to the iTunes library, thus I cannot seem to get it onto my iPod Video. I've tried the "add file/folder" on iTunes itself and don't know of any other way to transfer a file into iTu