//TODO: should check if the store actually supports charset
if (charset != null && charset.length() > 0) {
info.getConnectionParameters().put("charset", charset);
}
DataStoreFactorySpi targetFactory = factory;
if (!targetDataStoreFormat.equals(sourceDataStoreFormat)) {
//target is different, we need to create it
targetFactory = lookupDataStoreFactory(targetDataStoreFormat);
if (targetFactory == null) {
throw new RestletException( "Unable to create data store of type "
+ targetDataStoreFormat, Status.CLIENT_ERROR_BAD_REQUEST );
}
autoCreateParameters(info, namespace, targetFactory);
canRemoveFiles = true;
}
else {
updateParameters(info, namespace, targetFactory, uploadedFile);
}
info.setType(targetFactory.getDisplayName());
}
else {
LOGGER.info("Using existing datastore: " + datastore);
// look up the target data store factory