Package net.sf.basedb.util.fileset
Class SingleFileValidationAction
- java.lang.Object
-
- 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 (fr, 06 maj 2011) $
-
-
Field Summary
Fields Modifier and Type Field Description private FileSetMember
acceptedFile
private String
fileTypeId
-
Constructor Summary
Constructors Modifier Constructor Description protected
SingleFileValidationAction(String fileTypeId)
Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 theacceptFile(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 theDataFileType
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 interfaceValidationAction
- 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 theacceptFile(FileSetMember)
method.- Returns:
- A file set member object, or null if the last file was not accepted
-
-