stevedlawrence commented on code in PR #1479:
URL: https://github.com/apache/daffodil/pull/1479#discussion_r2075268070


##########
daffodil-runtime1/src/main/java/org/apache/daffodil/api/infoset/BlobMethods.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.api.infoset;
+
+import scala.collection.immutable.Seq;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * An available basic implementation of the BLOB methods.
+ * Stores blobs in files in directory identified by Java system property
+ * `java.io.tempdir`.
+ */
+public abstract class BlobMethods {
+
+  private Path blobDirectory = Paths.get(System.getProperty("java.io.tmpdir"));
+  private String blobPrefix = "daffodil-";
+  private String blobSuffix = ".blob";
+  private Seq<Path> blobPaths;
+
+  /**
+   * Set the attributes for how to create blob files.
+   *
+   * @param dir    the Path the the directory to create files. If the directory
+   *               does not exist, Daffodil will attempt to create it before
+   *               writing a blob.
+   * @param prefix the prefix string to be used in generating a blob file name
+   * @param suffix the suffix string to be used in generating a blob file name
+   */
+  public void setBlobAttributes(Path dir, String prefix, String suffix) {

Review Comment:
   Yeah, if an internal class doesn't provide any new functionality over the 
public API class and is just a proxy/wrapper I would suggest we get rid of it 
and directly reference the `api` interface. It just adds a level of indirection 
for no real benefit. I believe that is the case with InfosetOutputter.
   
   There are cases where the internal class does provide extra functions (e.g. 
DaffodilUnparseContentHandler provies 
enableResolutionOfRelativeInfosetBlobURIs), but I don't think our internal 
InfosetOutputter does that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to