use of com.ms.silverking.cloud.dht.common.NamespaceProperties in project SilverKing by Morgan-Stanley.
the class NamespacePropertiesIO method _write.
private static void _write(File nsDir, NamespaceProperties nsProperties, boolean allowRewrite) throws IOException {
if (!nsDir.isDirectory()) {
throw new IOException("NamespacePropertiesIO.write() passed non-directory: " + nsDir);
}
if (allowRewrite && propertiesFileExists(nsDir)) {
propertiesFile(nsDir).delete();
}
if (propertiesFileExists(nsDir)) {
NamespaceProperties existingProperties;
existingProperties = read(nsDir);
if (!nsProperties.equals(existingProperties)) {
System.err.println(nsProperties);
System.err.println(existingProperties);
System.err.println();
System.err.flush();
System.out.println(nsProperties);
System.out.println(existingProperties);
System.out.println();
System.out.flush();
nsProperties.debugEquals(existingProperties);
throw new RuntimeException("Existing properties != nsProperties");
}
} else {
_write(propertiesFile(nsDir), nsProperties);
}
}
Aggregations