javatools.filehandlers
Class FileSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<java.io.File>
              extended by javatools.filehandlers.FileSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.io.File>, java.util.Collection<java.io.File>, java.util.List<java.io.File>, java.util.RandomAccess

public class FileSet
extends java.util.ArrayList<java.io.File>

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). The class represents a set of files as given by a wildcard string. It does not include folders and is not case-sensitive.
Example:

         for(File f : new FileSet("c:\\myfiles\\*.jAvA"))
                 System.out.println(f);
         -->
             c:\myfiles\FileSet.java
             c:\myfiles\HTMLReader.java
             ...
   

See Also:
Serialized Form

Constructor Summary
FileSet(java.io.File folderPlusWildcard)
          Constructs a FileSet from a wildcard string (including path)
FileSet(java.io.File path, java.lang.String fname)
          Constructs a FileSet from a wildcard string
FileSet(java.lang.String folderPlusWildcard)
          Constructs a FileSet from a wildcard string (including path)
 
Method Summary
static java.lang.String extension(java.io.File f)
          Returns the extension of a filename
static java.lang.String extension(java.lang.String f)
          Returns the extension of a filename with dot
static java.io.File file(java.io.File f, java.lang.String... s)
          Constructs a file from a folder, subfolder names and a filename
static void main(java.lang.String[] argv)
          Test routine
static java.io.File newExtension(java.io.File f, java.lang.String newex)
          Exchanges the extension of a filename.
static java.lang.String newExtension(java.lang.String f, java.lang.String newex)
          Exchanges the extension of a filename
static java.io.File noExtension(java.io.File f)
          Deletes the file extension
static java.lang.String noExtension(java.lang.String f)
          Deletes the file extension
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

FileSet

public FileSet(java.lang.String folderPlusWildcard)
Constructs a FileSet from a wildcard string (including path)


FileSet

public FileSet(java.io.File folderPlusWildcard)
Constructs a FileSet from a wildcard string (including path)


FileSet

public FileSet(java.io.File path,
               java.lang.String fname)
Constructs a FileSet from a wildcard string

Method Detail

file

public static java.io.File file(java.io.File f,
                                java.lang.String... s)
Constructs a file from a folder, subfolder names and a filename


extension

public static java.lang.String extension(java.io.File f)
Returns the extension of a filename


extension

public static java.lang.String extension(java.lang.String f)
Returns the extension of a filename with dot


newExtension

public static java.io.File newExtension(java.io.File f,
                                        java.lang.String newex)
Exchanges the extension of a filename. This is different from newExtension(String) because the "last dot" may be in the folder name, if the file itself has no extension


newExtension

public static java.lang.String newExtension(java.lang.String f,
                                            java.lang.String newex)
Exchanges the extension of a filename


noExtension

public static java.lang.String noExtension(java.lang.String f)
Deletes the file extension


noExtension

public static java.io.File noExtension(java.io.File f)
Deletes the file extension


main

public static void main(java.lang.String[] argv)
Test routine