How do I create a sequentially numbered date based directory.?

This example shows you how to create a sequentially numbered date based directory.
package net.javaiq.examples.files;

import java.io.File;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

/**
 * This class demonstrates on how to create a sequentially numbered date based directory.
 * If a directory directory exists for the date the sequence will be increased.
 * This code is useful when you wanted to create directories for automated backups. 
 * This has been tested only windows but can be adapted for *nix 
 * @author JavaIQ.net
 * Creation Date Dec 10, 2010
 */
public class DateBasedDirectoryCreator {

    public static String createDateBasedDirectory(String baseDirectory, Date argDate) {
        String newDir = null;

        if (baseDirectory != null && argDate != null) {
            try {
                String format = "yyyy-MM-dd";
                DateFormat dateFormatter = new SimpleDateFormat(format);
                String date = dateFormatter.format(argDate);
                File f = new File(baseDirectory);
                File files[] = f.listFiles();
                String dir = null;
                int baseDirLength = baseDirectory.length();
                int checkingLength = baseDirLength + format.length() + 3;

                int maxSeqNo = 0;

                for (int i = 0; i < files.length; i++) {
                    if (files[i].isDirectory()) {
                        dir = files[i].toString();
                        if (dir.length() == checkingLength) {
                            String existingDirDate = dir.substring(baseDirLength, baseDirLength + 10);

                            if (date.equalsIgnoreCase(existingDirDate)) {
                                int dirSeqNo = 
                                    Integer.parseInt(dir.substring(baseDirLength + 11, baseDirLength + 10 + 3));

                                if (dirSeqNo > maxSeqNo) {
                                    maxSeqNo = dirSeqNo;
                                }
                            }
                        }
                    }
                }

                String currSeq = "" + (maxSeqNo + 1);
                if (currSeq.length() == 1) {
                    currSeq = "0" + currSeq;
                }

                newDir = baseDirectory + date + "-" + currSeq;
                new File(newDir).mkdir();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return newDir;
    }

    /**
     * Method to test other methods in the class with sample inputs
     * In this example 2 directories are created for current date and 1 directory for a previous date.
     * Make sure the base directory in the file system with proper access.
     * @param args
     */
    public static void main(String[] args) throws ParseException {
        Date currentDate = new java.util.Date(System.currentTimeMillis());
        String baseDir = "C:/Admin/Backup/";
        String newDir = createDateBasedDirectory(baseDir, currentDate);
        System.out.println("New Directory 1 :: " + newDir);

        newDir = createDateBasedDirectory(baseDir, currentDate);
        System.out.println("New Directory 2 :: " + newDir);

        Date oldDate = new SimpleDateFormat("yyyy-MM-dd").parse("2010-12-09");
        newDir = createDateBasedDirectory(baseDir, oldDate);
        System.out.println("New Directory 3:: " + newDir);
    }
}