Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency updates #38

Merged
merged 8 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 12 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,21 @@
</pluginRepositories>

<dependencies>

<dependency>
<groupId>ome</groupId>
<artifactId>formats-api</artifactId>
<version>6.10.0</version>
</dependency>
<dependency>
<groupId>com.bc.zarr</groupId>
<artifactId>jzarr</artifactId>
<version>0.3.4</version>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>2.5.1</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version shipped in ome-common (via kryo 4.0.2). From mvn dependency:tree -Dverbose it looks like it is conflicting with the version from org.mockito:mockito-inline:3.7.7.

Declaring it in the POM should suffice although I assume an alternative would be to add and exclude in the mockito dependency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick discussion with @dgault and @jburel, a possible simpler and more effective option would simply be to declare mockito and testng as test dependencies (via scope). This might suffice to exclude these from the openmicroscopy Ivy resolution and prevent the copying of unnecessary JARs into the lib folder

</dependency>

<dependency>
<groupId>org.mockito</groupId>
Expand All @@ -72,31 +81,10 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<version>6.10</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.13.8</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</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 All @@ -111,16 +99,7 @@
<version>2.7.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>ome</groupId>
<artifactId>formats-api</artifactId>
<version>6.7.0</version>
</dependency>



</dependencies>
Expand Down
263 changes: 0 additions & 263 deletions src/loci/formats/S3FileSystemStore.java

This file was deleted.

27 changes: 9 additions & 18 deletions src/loci/formats/in/ZarrReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;

import org.apache.commons.io.FileUtils;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

Expand All @@ -62,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 @@ -832,22 +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:")) {
File folder = new File(zarrRootPath);
Collection<File> libs = FileUtils.listFiles(folder, null, true);
for (File file : libs) {
if (!file.isDirectory()) {
usedFiles.add(file.getAbsolutePath());
}
}
}
else {
try {
usedFiles.addAll(new S3FileSystemStore(Paths.get(zarrRootPath)).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