New topics: Your Pet, IOU, Baby IQ, The Poisons, Birther II, Games, Future Power

Welcome to the Tech Space!

Check out Linux...

Skip to end of metadata
Go to start of metadata

Don't forget to check for no children being returned!

	private static void deleteHTMLFromDir(String sOutputDir) {
		File dir = new File(sOutputDir);
		FilenameFilter filter = new FilenameFilter() {
			public boolean accept(File dir, String name) {
				return !name.startsWith(".") &&				
				new File(dir.getAbsolutePath() + File.separator + name).isFile() &&
				(name.endsWith(".htm") || 
						name.endsWith(".html") ||
						name.endsWith(".shtml"));
			}
		};
		String[] children = dir.list(filter);
		if (children!=null)
		for (String sFilename : children)
		{
			new File(sOutputDir + File.separator + sFilename).delete();
		}
	}

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.