2.17.2: 2011-06-17

net.sf.basedb.core.filehandler
Interface DataFileValidator

All Superinterfaces:
DataFileHandler
All Known Implementing Classes:
CdfFileHandler, CelFileHandler

public interface DataFileValidator
extends DataFileHandler

This interface should be implemented by classes that are used to validate a file of a specific DataFileType. The class to use for validation is specified by the DataFileType.getValidatorClass() property.

Version:
2.5
Author:
Nicklas
Last modified
$Date: 2008-09-11 22:09:17 +0200 (Thu, 11 Sep 2008) $

Method Summary
 void validate(DbControl dc)
          Validate the file(s) that has been added to this validator with the DataFileHandler.setFile(net.sf.basedb.core.FileSetMember) method.
 
Methods inherited from interface net.sf.basedb.core.filehandler.DataFileHandler
setFile, setItem
 

Method Detail

validate

void validate(DbControl dc)
              throws InvalidDataException,
                     InvalidRelationException
Validate the file(s) that has been added to this validator with the DataFileHandler.setFile(net.sf.basedb.core.FileSetMember) method. This method is recommended to throw an InvalidDataException or a subclass if the file is not a valid file. PermissionDeniedException:s are ignored by the core and will not change the validation status. An exception of type InvalidRelationException is thrown the file itself is valid, but a related file that it depends on is not. The core will still mark the file as invalid and store the error message, but metadata extraction will still be performed.

Parameters:
dc - A DbControl object that can be used for database access
Throws:
InvalidDataException - If the validator detects an invalid file
InvalidRelationException - If the validator detects that the file is valid but another file that it depends on is not, metadata extract will still happen

2.17.2: 2011-06-17