Skip to content

Commit 588c071

Browse files
committed
Remove S3 handling
1 parent 64966e3 commit 588c071

10 files changed

Lines changed: 8 additions & 1368 deletions

File tree

pom.xml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -87,51 +87,6 @@
8787
</ciManagement>
8888

8989
<dependencies>
90-
<dependency>
91-
<groupId>io.minio</groupId>
92-
<artifactId>minio</artifactId>
93-
<version>5.0.2</version>
94-
<exclusions>
95-
<exclusion>
96-
<groupId>commons-codec</groupId>
97-
<artifactId>commons-codec</artifactId>
98-
</exclusion>
99-
<exclusion>
100-
<groupId>commons-logging</groupId>
101-
<artifactId>commons-logging</artifactId>
102-
</exclusion>
103-
<exclusion>
104-
<groupId>com.google.code.findbugs</groupId>
105-
<artifactId>annotations</artifactId>
106-
</exclusion>
107-
<exclusion>
108-
<groupId>com.google.code.findbugs</groupId>
109-
<artifactId>jsr305</artifactId>
110-
</exclusion>
111-
<exclusion>
112-
<groupId>com.fasterxml.jackson.core</groupId>
113-
<artifactId>jackson-databind</artifactId>
114-
</exclusion>
115-
<exclusion>
116-
<groupId>com.fasterxml.jackson.core</groupId>
117-
<artifactId>jackson-core</artifactId>
118-
</exclusion>
119-
<exclusion>
120-
<groupId>com.fasterxml.jackson.core</groupId>
121-
<artifactId>jackson-annotations</artifactId>
122-
</exclusion>
123-
</exclusions>
124-
</dependency>
125-
<dependency>
126-
<groupId>com.fasterxml.jackson.core</groupId>
127-
<artifactId>jackson-databind</artifactId>
128-
<version>2.14.2</version>
129-
</dependency>
130-
<dependency>
131-
<groupId>com.fasterxml.jackson.core</groupId>
132-
<artifactId>jackson-annotations</artifactId>
133-
<version>2.14.2</version>
134-
</dependency>
13590
<dependency>
13691
<groupId>com.esotericsoftware</groupId>
13792
<artifactId>kryo</artifactId>

src/main/java/loci/common/Location.java

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,8 @@ public Location(String parent, String child) {
203203
pathname = child;
204204
uri = new URI(mapped);
205205
isURL = true;
206-
if (S3Handle.canHandleScheme(uri.toString())) {
207-
urlType = UrlType.S3;
208-
url = null;
209-
}
210-
else {
211-
urlType = UrlType.GENERIC;
212-
url = uri.toURL();
213-
}
206+
urlType = UrlType.GENERIC;
207+
url = uri.toURL();
214208
}
215209
catch (URISyntaxException | MalformedURLException e) {
216210
// Readers such as FilePatternReader may pass invalid URI paths
@@ -485,23 +479,8 @@ public static IRandomAccess getHandle(String id, boolean writable,
485479
LOGGER.trace("no handle was mapped for this ID");
486480
String mapId = getMappedId(id);
487481

488-
if (S3Handle.canHandleScheme(id)) {
489-
StreamHandle.Settings ss = new StreamHandle.Settings();
490-
if (ss.getRemoteCacheRootDir() != null) {
491-
String cachedFile = S3Handle.cacheObject(mapId, ss);
492-
if (bufferSize > 0) {
493-
handle = new NIOFileHandle(
494-
new File(cachedFile), "r", bufferSize);
495-
}
496-
else {
497-
handle = new NIOFileHandle(cachedFile, "r");
498-
}
499-
}
500-
else {
501-
handle = new S3Handle(mapId);
502-
}
503-
}
504-
else if (id.startsWith("http://") || id.startsWith("https://")) {
482+
if (id.startsWith("http://") || id.startsWith("https://")
483+
|| id.startsWith("s3://")) {
505484
handle = new URLHandle(mapId);
506485
}
507486
else if (allowArchiveHandles && ZipHandle.isZipFile(mapId)) {
@@ -917,32 +896,9 @@ public boolean isAbsolute() {
917896
public boolean isDirectory() {
918897
LOGGER.trace("isDirectory()");
919898
if (isURL) {
920-
if (urlType == UrlType.S3) {
921-
// TODO: This is complicated
922-
//
923-
// S3 doesn't have directories, but keys can contain / which we
924-
// can pretend is a file path. However this "directory" doesn't
925-
// actually exist, only the "contents" of the directory exist.
926-
//
927-
// Minio.listObjects() lists all objects in a bucket that
928-
// match an optional prefix so this could be an option for checking
929-
// whether to trest this as a directory.
930-
//
931-
// S3 buckets are the closest thing to a proper directory
932-
// so for now
933-
try {
934-
S3Handle h = new S3Handle(uri.toString());
935-
boolean isBucket = h.isBucket();
936-
h.close();
937-
return isBucket;
938-
} catch (IOException e) {
939-
throw new UncheckedIOException(e);
940-
}
941-
} else {
942-
// TODO: this should be removed as well.
943-
String[] list = list();
944-
return list != null;
945-
}
899+
// TODO: this should be removed as well.
900+
String[] list = list();
901+
return list != null;
946902
}
947903
return file.isDirectory();
948904
}

0 commit comments

Comments
 (0)