Developer's Daily Java Education - Test Projects
  front page | java | perl | unix | DevDirectory
   
Front Page
Java
Education
   
 



import java.io.File;
import java.util.Arrays;

public class DirectoryTestMain
{
  public static void main(String[] args)
  {
    // create a file that is really a directory
    File aDirectory = new File("C:/temp");

    // get a listing of all files in the directory
    String[] filesInDir = aDirectory.list();

    // sort the list of files (optional)
    Arrays.sort(filesInDir);

    // have everything i need, just print it now
    for ( int i=0; i
      
Copyright 1998-2003 DevDaily Interactive, Inc.
All Rights Reserved.