public final <E extends T> boolean write(File file, E persist, Object... args) {
    if (file != null) {
      try (OutputStream out = Files.newOutputStream(file.toPath())) {
        return write(out, persist, args);
      } catch (IOException xio) {
        writeError(xio, "error writing " + file);
      }
    }
    return false;
  }
Saves an object to persistent storage.

@param <E> the class of the object to persist
@param file    the file to write to; it will be created if it does not exist, overwritten otherwise
@param persist the object to serialize
@param args    the proxy arguments
@return true if successful, false if file is null
@throws SerializationProxy.ProxyException in case of low level error
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/Serializer.java