Skip to content

Commit

Permalink
Remove AWS dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dgault committed Jun 10, 2022
1 parent feb1492 commit a195d7c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 312 deletions.
18 changes: 0 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,6 @@
<version>6.8</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.13.8</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sts</artifactId>
<version>2.13.8</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.11.10</version>
<type>pom</type>
</dependency>
<dependency>
<!-- NB: We want this, despite warning from dependency:analyze. -->
<groupId>xalan</groupId>
Expand Down
263 changes: 0 additions & 263 deletions src/loci/formats/S3FileSystemStore.java

This file was deleted.

21 changes: 6 additions & 15 deletions src/loci/formats/in/ZarrReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import loci.formats.FormatReader;
import loci.formats.FormatTools;
import loci.formats.MetadataTools;
import loci.formats.S3FileSystemStore;
import loci.formats.meta.MetadataStore;
import loci.formats.ome.OMEXMLMetadata;
import loci.formats.services.JZarrServiceImpl;
Expand Down Expand Up @@ -833,21 +832,13 @@ public String[] getUsedFiles(boolean noPixels) {
FormatTools.assertId(currentId, true, 1);
String zarrRootPath = currentId.substring(0, currentId.indexOf(".zarr") + 5);
ArrayList<String> usedFiles = new ArrayList<String>();
if (!zarrRootPath.toLowerCase().contains("s3:")) {
try (Stream<Path> paths = Files.walk(Paths.get(zarrRootPath))) {
paths.filter(Files::isRegularFile)
.forEach(path -> usedFiles.add(path.toFile().getAbsolutePath()));
} catch (IOException e) {
e.printStackTrace();
}
}
else {
try (S3FileSystemStore s3Store = new S3FileSystemStore(Paths.get(zarrRootPath))) {
usedFiles.addAll(s3Store.getFiles());
} catch (IOException e) {
e.printStackTrace();
}
try (Stream<Path> paths = Files.walk(Paths.get(zarrRootPath))) {
paths.filter(Files::isRegularFile)
.forEach(path -> usedFiles.add(path.toFile().getAbsolutePath()));
} catch (IOException e) {
e.printStackTrace();
}

String[] fileArr = new String[usedFiles.size()];
fileArr = usedFiles.toArray(fileArr);
return fileArr;
Expand Down
Loading

0 comments on commit a195d7c

Please sign in to comment.