Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Delete A Directory

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to delete a diretory (Files) using java and it is working when i run the respective .class by keeping it out of directory.
But if i keep the .class in the same directory where i am trying to delete , there then it is deleting all other files except the .class and therefore the directory remains as it is.

It will be great if any one could suggest this.

regards
satya
 
Marshal
Posts: 69894
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you expect to delete a directory while its contained files are in use?
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, this is for like Uninstalling a application.
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First i created an Executable .jar file, where this will delete ( Clean ) all Files in the Directory(Application) and then finally the Directory(Application).
I placed this .jar inside the Directory, so that to uninstall this Application i click on this .jar.


Thank you
satya
 
Campbell Ritchie
Marshal
Posts: 69894
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, I am afraid.

Anybody else?
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you considered copying the jar to a temp location and then executing it from there? Files in the temp location get cleaned up by the OS.
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i tried by keeping the jar in temp location(out side of the application ) and it was deleting the Directory, but my requirement is that , the executable jar named "Uninstaller.jar" (which performs deleting the Directory) will be there inside my application under the UnInstaller Folder and it should delete entire Application when i click the uninstaller.jar.


But it is Not working, instead of that it is cleaning all files except the Uninstaller Folder as it is in Progress and so the application is not removed completely.


So any one can help me in doing this ?

thank you
Satya
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i'm waiting for a solution so if any one it will be help full.

Once Again the requirement is, Uninstalling the application using java.
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends i'm using Cmdow.exe Command Line Window Utility for hiding, listing, hiding/unhidingminimizing.maximiging,enabling.disabling of Batch files (and for Other purposese also) i used this cmdow.exe in my application diirectly when installing my application . But sometimes in someother machines while it is being installing it is identified as Virus, this is Becuase the Anti Virus makers decided to destroy because of its hiding a file feature.


So i'm looking for alternate for cmdow.exe
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use UseOneThreadPerQuestion.
 
A tiny monkey bit me and I got tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic