Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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: 0 additions & 45 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,51 +87,6 @@
</ciManagement>

<dependencies>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>5.0.2</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.14.2</version>
</dependency>
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
Expand Down
58 changes: 7 additions & 51 deletions src/main/java/loci/common/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,8 @@ public Location(String parent, String child) {
pathname = child;
uri = new URI(mapped);
isURL = true;
if (S3Handle.canHandleScheme(uri.toString())) {
urlType = UrlType.S3;
url = null;
}
else {
urlType = UrlType.GENERIC;
url = uri.toURL();
}
urlType = UrlType.GENERIC;
url = uri.toURL();
}
catch (URISyntaxException | MalformedURLException e) {
// Readers such as FilePatternReader may pass invalid URI paths
Expand Down Expand Up @@ -485,23 +479,8 @@ public static IRandomAccess getHandle(String id, boolean writable,
LOGGER.trace("no handle was mapped for this ID");
String mapId = getMappedId(id);

if (S3Handle.canHandleScheme(id)) {
StreamHandle.Settings ss = new StreamHandle.Settings();
if (ss.getRemoteCacheRootDir() != null) {
String cachedFile = S3Handle.cacheObject(mapId, ss);
if (bufferSize > 0) {
handle = new NIOFileHandle(
new File(cachedFile), "r", bufferSize);
}
else {
handle = new NIOFileHandle(cachedFile, "r");
}
}
else {
handle = new S3Handle(mapId);
}
}
else if (id.startsWith("http://") || id.startsWith("https://")) {
if (id.startsWith("http://") || id.startsWith("https://")
|| id.startsWith("s3://")) {
handle = new URLHandle(mapId);
}
else if (allowArchiveHandles && ZipHandle.isZipFile(mapId)) {
Expand Down Expand Up @@ -917,32 +896,9 @@ public boolean isAbsolute() {
public boolean isDirectory() {
LOGGER.trace("isDirectory()");
if (isURL) {
if (urlType == UrlType.S3) {
// TODO: This is complicated
//
// S3 doesn't have directories, but keys can contain / which we
// can pretend is a file path. However this "directory" doesn't
// actually exist, only the "contents" of the directory exist.
//
// Minio.listObjects() lists all objects in a bucket that
// match an optional prefix so this could be an option for checking
// whether to trest this as a directory.
//
// S3 buckets are the closest thing to a proper directory
// so for now
try {
S3Handle h = new S3Handle(uri.toString());
boolean isBucket = h.isBucket();
h.close();
return isBucket;
} catch (IOException e) {
throw new UncheckedIOException(e);
}
} else {
// TODO: this should be removed as well.
String[] list = list();
return list != null;
}
// TODO: this should be removed as well.
String[] list = list();
return list != null;
}
return file.isDirectory();
}
Expand Down
Loading