/**
* Tests what sort of wildcard expansion happens automatically.
* It is very simple. Just look at the main method code to understand
* what it does and what you could use it for.
*
* try with:
* java WildcardExpansion *.*
* java WildcardExpansion "*.*"
* java WildcardExpansion s*.*
* java WildcardExpansion .
* java WildcardExpansion *.html
* java WildcardExpansion afile.txt anotherfile.txt
* java WildcardExpansion d?mmy.* (where you have dummy.* files and a dummy dir)
* java WildcardExpansion t?mmy.* (where you don't have tummy.* files or a tummy dir)
*
* My discoveries: For Win2K:
* Wildcards are automatically expanded before your program sees them.
* Who does it? Presumably the command processor or a Sun class.
* You get a list of matching files INCLUDING matching directory names,
* but not the files in those subdirectories. Since directories normally
* don't have extensions, you won't see the problem with *.html but you will
* with s*.* or *.*.
* If the wildcard does not match anything, you get the raw wildcard.
* The wildcard in quotes gives you the raw wildcard.
* Author Roedy Green
* Version 1.0
*/
public class WildcardExpansion
{
/**
* Echo command line arguments, along with any automatic expansion.
* Can be used to test wildcard expansion, quoting, or any other basic features
* features of command line parsing.
*
* @param args whatever you want to test.
*/
public static void main ( String[] args )
{
System.out.println ( args.length + " arguments" );
for ( int i=0; i<args.length; i++ )
{
System.out.println( "[" + args[i] + "]" );
}
}
}