This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 06fc3757ff Implement the `getFileSet()` method in `GeoTiffStore`.
06fc3757ff is described below

commit 06fc3757ffe02cc4f800a180c725fc81e9247d7b
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Mon Jan 6 15:24:37 2025 +0100

    Implement the `getFileSet()` method in `GeoTiffStore`.
---
 .../main/org/apache/sis/storage/geotiff/DataCube.java      |  6 ++----
 .../main/org/apache/sis/storage/geotiff/GeoTiffStore.java  | 14 ++++++++++++++
 .../apache/sis/storage/geotiff/MultiResolutionImage.java   |  2 +-
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git 
a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataCube.java
 
b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataCube.java
index 1daafb6383..a92eb5e084 100644
--- 
a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataCube.java
+++ 
b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataCube.java
@@ -17,7 +17,6 @@
 package org.apache.sis.storage.geotiff;
 
 import java.util.Optional;
-import java.nio.file.Path;
 import java.awt.image.DataBuffer;
 import java.awt.image.SampleModel;
 import java.awt.image.BandedSampleModel;
@@ -113,9 +112,8 @@ abstract class DataCube extends TiledGridResource 
implements StoreResource {
      * Gets the paths to files used by this resource, or an empty value if 
unknown.
      */
     @Override
-    public final Optional<FileSet> getFileSet() {
-        final Path location = reader.store.path;
-        return (location != null) ? Optional.of(new FileSet(location)) : 
Optional.empty();
+    public final Optional<FileSet> getFileSet() throws DataStoreException {
+        return reader.store.getFileSet();
     }
 
     /**
diff --git 
a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java
 
b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java
index d17f719e18..76303e2e81 100644
--- 
a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java
+++ 
b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStore.java
@@ -469,6 +469,20 @@ public class GeoTiffStore extends DataStore implements 
Aggregate {
         return Optional.of(nativeMetadata);
     }
 
+    /**
+     * Returns the paths to the files used by this GeoTIFF store.
+     * The fileset contains the path of the file given at construction time.
+     *
+     * @return files used by this resource, or an empty value if unknown.
+     * @throws DataStoreException if an error occurred while preparing the set 
of files.
+     *
+     * @since 1.5
+     */
+    @Override
+    public Optional<FileSet> getFileSet() throws DataStoreException {
+        return (path != null) ? Optional.of(new FileSet(path)) : 
Optional.empty();
+    }
+
     /**
      * {@return the object to use for parsing and formatting dates}.
      */
diff --git 
a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/MultiResolutionImage.java
 
b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/MultiResolutionImage.java
index 617f788f75..21717f1f15 100644
--- 
a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/MultiResolutionImage.java
+++ 
b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/MultiResolutionImage.java
@@ -97,7 +97,7 @@ final class MultiResolutionImage extends GridResourceWrapper 
implements StoreRes
      * Gets the paths to files used by this resource, or an empty value if 
unknown.
      */
     @Override
-    public final Optional<FileSet> getFileSet() {
+    public final Optional<FileSet> getFileSet() throws DataStoreException {
         return levels[0].getFileSet();
     }
 

Reply via email to