skip to main | skip to sidebar

My Programming World

Saturday, August 2, 2008

Java: Delete files in a directory

public void deleteFiles(){
   java.io.File file = new java.io.File("d:\\test");
   java.io.File[] f = file.listFiles();
   for (int i = 0; i < f.length; i++) {
      f[i].delete();
   }
}
Posted by Nasa at 9:42 AM
Labels: Java: Delete files in a directory

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Since 26 July 2008:

Java

  • Java: 2D Array Declaration (1)
  • Java: Add day to a Date (1)
  • Java: Call an Oracle Stored Procedure (1)
  • Java: Cast ArrayList to Array (1)
  • Java: Check server response (1)
  • Java: Compare 2 dates (1)
  • Java: Date Format (1)
  • Java: Delete files in a directory (1)
  • Java: Distinct List Function (1)
  • Java: Download files from HTTP (1)
  • Java: Get Current Directory (1)
  • Java: Increase Heap Size (1)
  • Java: Redirect Java Output to a File (1)
  • Java: Rename a file (1)

Jsp

  • Jsp: Download Attachment File
  • Jsp: Set Browser Expired Time

Blog Archive

  • ►  2014 (2)
    • ►  April (1)
    • ►  March (1)
  • ▼  2008 (14)
    • ▼  August (8)
      • Java: Distinct List Function
      • Jsp: Set Browser Expired Time
      • Java: Increase Heap Size to prevent java.lang.OutO...
      • Java: Redirect Java Output to a File
      • Java: Get Current Directory
      • Java: Rename a file
      • Java: Download files from HTTP
      • Java: Delete files in a directory
    • ►  July (6)