use of com.amazonaws.services.kms.model.InvalidArnException in project ozone by apache.
the class DBDefinitionFactory method getDefinition.
public static DBDefinition getDefinition(Path dbPath) {
Preconditions.checkNotNull(dbPath, "Path is required to identify the used db scheme");
final Path fileName = dbPath.getFileName();
if (fileName == null) {
throw new InvalidArnException("Path is required to identify the used db scheme");
}
String dbName = fileName.toString();
if (dbName.endsWith("-container.db")) {
switch(dnDBSchemaVersion) {
case "V1":
return new DatanodeSchemaOneDBDefinition(dbPath.toAbsolutePath().toString());
default:
return new DatanodeSchemaTwoDBDefinition(dbPath.toAbsolutePath().toString());
}
}
return getDefinition(dbName);
}
use of com.amazonaws.services.kms.model.InvalidArnException in project aws-sdk-android by aws-amplify.
the class InvalidArnExceptionUnmarshaller method unmarshall.
@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {
InvalidArnException e = (InvalidArnException) super.unmarshall(error);
e.setErrorCode("InvalidArnException");
return e;
}
use of com.amazonaws.services.kms.model.InvalidArnException in project ozone by apache.
the class DBDefinitionFactory method getDefinition.
public static DBDefinition getDefinition(Path dbPath, ConfigurationSource config) {
Preconditions.checkNotNull(dbPath, "Path is required to identify the used db scheme");
final Path fileName = dbPath.getFileName();
if (fileName == null) {
throw new InvalidArnException("Path is required to identify the used db scheme");
}
String dbName = fileName.toString();
if (dbName.endsWith("container.db")) {
switch(dnDBSchemaVersion) {
case "V1":
return new DatanodeSchemaOneDBDefinition(dbPath.toAbsolutePath().toString(), config);
case "V3":
return new DatanodeSchemaThreeDBDefinition(dbPath.toAbsolutePath().toString(), config);
default:
return new DatanodeSchemaTwoDBDefinition(dbPath.toAbsolutePath().toString(), config);
}
}
return getDefinition(dbName);
}
Aggregations