try {
inputStream = rootFileSystem.open(descriptorPath);
properties.load(inputStream);
threw = false;
} catch (IOException e) {
throw new DatasetIOException(
"Unable to load descriptor file:" + descriptorPath +
" for dataset:" + name, e);
} finally {
try {
Closeables.close(inputStream, threw);
} catch (IOException e) {
throw new DatasetIOException("Cannot close", e);
}
}
if (properties.containsKey(FORMAT_FIELD_NAME)) {
builder.format(Accessor.getDefault().newFormat(
properties.getProperty(FORMAT_FIELD_NAME)));
}
if (properties.containsKey(COMPRESSION_TYPE_FIELD_NAME)) {
builder.compressionType(properties.getProperty(COMPRESSION_TYPE_FIELD_NAME));
}
if (properties.containsKey(PARTITION_EXPRESSION_FIELD_NAME)) {
builder.partitionStrategy(Accessor.getDefault().fromExpression(properties
.getProperty(PARTITION_EXPRESSION_FIELD_NAME)));
}
Path schemaPath = new Path(metadataPath, SCHEMA_FILE_NAME);
try {
builder.schemaUri(rootFileSystem.makeQualified(schemaPath).toUri());
} catch (IOException e) {
throw new DatasetIOException(
"Unable to load schema file:" + schemaPath + " for dataset:" + name, e);
}
final Path location;
if (properties.containsKey(LOCATION_FIELD_NAME)) {