gnodet commented on code in PR #1197:
URL: https://github.com/apache/maven/pull/1197#discussion_r1253378478


##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/Source.java:
##########
@@ -20,17 +20,35 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Path;
 
 import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.Nullable;
 
 /**
- * The source for a project's XML model.
+ * The source for parsing an object.
  *
  * @since 4.0.0
  */
 @Experimental
 public interface Source {
+
+    /**
+     * Provides access the file to be parsed, if this source is backed by a 
file.
+     */
+    @Nullable
+    Path getPath();
+
+    /**
+     * Creates a readable stream.
+     */
+    @Nonnull
     InputStream getInputStream() throws IOException;
 
+    /**
+     * Retrieves the location for this source, useful to display to the user.

Review Comment:
   The location could be a URL.  The point is that `getPath()` returns a path, 
but may be `null` if the source is created with an `InputStream`.



-- 
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: issues-unsubscr...@maven.apache.org

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

Reply via email to