org.glite.jdl
Class ExtractFiles

java.lang.Object
  extended by org.glite.jdl.ExtractFiles
All Implemented Interfaces:
java.io.FilenameFilter

public class ExtractFiles
extends java.lang.Object
implements java.io.FilenameFilter

This class is used principally by JobAd class. It provides a series of utilities such as extracting a wildcards file extraction from a path

Version:
0.1
Author:
Alessandro Maraschini

Constructor Summary
ExtractFiles()
          Empty default constructor
ExtractFiles(java.lang.String file)
          Constructor from string
ExtractFiles(java.util.Vector files)
          Constructor with a Vector of Strings
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
           
 void check(java.lang.String name)
          Check for duplicates or unexisting paths
 java.util.HashSet getDuplicateFiles()
          Check for duplicate simple files
 java.util.Vector getMatchingFiles()
          Extract the files containing wildcards
static java.lang.String getName(java.lang.String path)
           
 java.util.HashSet getNoMatchingFiles()
          Check for No matching files
static boolean isAbsolute(java.lang.String path)
          check wheater the path correspond to an absolute name with no SO dependencies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractFiles

public ExtractFiles()
Empty default constructor


ExtractFiles

public ExtractFiles(java.lang.String file)
Constructor from string

Parameters:
file - the path of the file to be extraced in its string representation

ExtractFiles

public ExtractFiles(java.util.Vector files)
Constructor with a Vector of Strings

Parameters:
files - a Vector of paths to be extracted
Method Detail

getMatchingFiles

public java.util.Vector getMatchingFiles()
Extract the files containing wildcards

Returns:
a vector of Strings without wildcards, with the full path extracted

check

public void check(java.lang.String name)
           throws JobAdException
Check for duplicates or unexisting paths

Parameters:
name - the name of the attribute cheked
Throws:
JobAdException - if one or more file has a duplicated name or if it's impossible to find one or more specified path

getNoMatchingFiles

public java.util.HashSet getNoMatchingFiles()
Check for No matching files

Returns:
a HashSet contaning all the paths unable to be found

getDuplicateFiles

public java.util.HashSet getDuplicateFiles()
Check for duplicate simple files

Returns:
a HashSet contaning all the paths unable to be found

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Specified by:
accept in interface java.io.FilenameFilter

getName

public static java.lang.String getName(java.lang.String path)

isAbsolute

public static boolean isAbsolute(java.lang.String path)
check wheater the path correspond to an absolute name with no SO dependencies

Parameters:
path - the string corresponding to the path to be checked
Returns:
true if the path is absolute, false otherwise