private DeviceRepository createDeviceRepository(
String deviceRepositoryFileName) throws RepositoryException {
// Create a device repository using the accessor and repository.
// This is a bit easier to work with than the accessor.
final DeviceRepositoryFactory repositoryFactory =
DeviceRepositoryFactory.getDefaultInstance();
final XMLDeviceRepositoryConfiguration configuration =
repositoryFactory.createXMLDeviceRepositoryConfiguration();
try {
configuration.setRepositoryURL(
new File(deviceRepositoryFileName).toURL());
final DeviceRepository deviceRepository =
repositoryFactory.createDeviceRepository(configuration);
return deviceRepository;
} catch (MalformedURLException e) {
throw new RepositoryException(e);
} catch (DeviceRepositoryException e) {
throw new RepositoryException(e);