long offset; // check for obvious errors first
try {
offset = Long.parseLong(m.group(5));
} catch (NumberFormatException e) {
log.warn("malformed line " + cmd);
throw new AdaptorException("bad input syntax");
}
String adaptorID = m.group(1);
String adaptorClassName = m.group(2);
String dataType = m.group(3);
String params = m.group(4);
if (params == null)
params = "";
Adaptor adaptor = AdaptorFactory.createAdaptor(adaptorClassName);
if (adaptor == null) {
log.warn("Error creating adaptor of class " + adaptorClassName);
throw new AdaptorException("Can't load class " + adaptorClassName);
}
String coreParams = adaptor.parseArgs(dataType,params,this);
if(coreParams == null) {
log.warn("invalid params for adaptor: " + params);
throw new AdaptorException("invalid params for adaptor: " + params);
}
if(adaptorID == null) { //user didn't specify, so synthesize
try {
adaptorID = AdaptorNamingUtils.synthesizeAdaptorID(adaptorClassName, dataType, coreParams);