3.1.2: 2012-07-31

net.sf.basedb.util.fileset
Class SingleFileValidationAction

java.lang.Object
  extended by net.sf.basedb.util.fileset.SingleFileValidationAction
All Implemented Interfaces:
Action, ValidationAction
Direct Known Subclasses:
CdfValidationAction, CelValidationAction, GtfValidationAction

public abstract class SingleFileValidationAction
extends Object
implements ValidationAction

Base class for validators that works on single files of a known data file type. The external if of the file type should be specified in the constructor.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-05-06 14:09:13 +0200 (Fri, 06 May 2011) $

Field Summary
private  FileSetMember acceptedFile
           
private  String fileTypeId
           
 
Constructor Summary
protected SingleFileValidationAction(String fileTypeId)
          Create a new instance.
 
Method Summary
 Accept acceptFile(FileSetMember member)
          If the file has a file type matching the id given in the constructor it is accepted for immediate validation.
protected  FileSetMember getAcceptedFile()
          Get the file that was last accepted by the acceptFile(FileSetMember) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.util.fileset.ValidationAction
resetMetadata, validateAndExtractMetadata
 

Field Detail

fileTypeId

private final String fileTypeId

acceptedFile

private FileSetMember acceptedFile
Constructor Detail

SingleFileValidationAction

protected SingleFileValidationAction(String fileTypeId)
Create a new instance.

Parameters:
fileTypeId - The external if of the DataFileType that this validator supports
Method Detail

acceptFile

public Accept acceptFile(FileSetMember member)
If the file has a file type matching the id given in the constructor it is accepted for immediate validation.

Specified by:
acceptFile in interface ValidationAction
Parameters:
member - A member of the current file set
Returns:
Accept.VALIDATE_IMMEDIATELY or null

getAcceptedFile

protected FileSetMember getAcceptedFile()
Get the file that was last accepted by the acceptFile(FileSetMember) method.

Returns:
A file set member object, or null if the last file was not accepted

3.1.2: 2012-07-31