Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
.DS_Store
target
.idea
Expand Down
5 changes: 0 additions & 5 deletions location-server/.gitignore

This file was deleted.

34 changes: 0 additions & 34 deletions location-server/start-location.sh

This file was deleted.

44 changes: 0 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,51 +87,11 @@
</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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason to keep jackson-databind?

<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 Expand Up @@ -260,10 +220,6 @@
<suiteXmlFiles>
<suiteXmlFile>src/test/java/loci/common/utests/testng-template.xml</suiteXmlFile>
</suiteXmlFiles>
<systemPropertyVariables>
<testng.runHttpRemoteTests>0</testng.runHttpRemoteTests>
<testng.runS3RemoteTests>0</testng.runS3RemoteTests>
</systemPropertyVariables>
</configuration>
</plugin>

Expand Down
1 change: 0 additions & 1 deletion src/main/java/loci/common/CaseInsensitiveLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;

/**
* Case insensitive variant of Location.
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/loci/common/DateTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@

package loci.common;

import java.text.FieldPosition;
import java.text.ParsePosition;
import java.util.Locale;

import org.joda.time.DateTime;
Expand Down
78 changes: 6 additions & 72 deletions src/main/java/loci/common/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -68,12 +67,6 @@ public class Location {
private static final boolean IS_WINDOWS =
System.getProperty("os.name").startsWith("Windows");

// -- Enumerations --
protected enum UrlType {
GENERIC,
S3
};

// -- Static fields --

/** Map from given filenames to actual filenames. */
Expand Down Expand Up @@ -113,7 +106,6 @@ protected class ListingsResult {
// -- Fields --

private boolean isURL = false;
private UrlType urlType;
private URL url;
private URI uri;
private File file;
Expand Down Expand Up @@ -203,21 +195,13 @@ 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();
}
url = uri.toURL();
}
catch (URISyntaxException | MalformedURLException e) {
// Readers such as FilePatternReader may pass invalid URI paths
// containing <> so don't throw, instead treat as a non-URL
LOGGER.debug("Invalid URL: {} {}", child, e);
isURL = false;
urlType = null;
url = null;
uri = null;
}
Expand Down Expand Up @@ -486,23 +470,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 @@ -575,18 +544,6 @@ public String[] list(boolean noHiddenFiles) {
final List<String> files = new ArrayList<String>();
if (isURL) {
try {
if (urlType == UrlType.S3) {
if (isDirectory()) {
// TODO: This is complicated, not sure what to do here
// See comment in isDirectory()
LOGGER.trace("list s3 {}: Returning []", uri);
return new String[0];
}
else {
LOGGER.trace("list s3 {}: Returning null", uri);
return null;
}
}
URLConnection c = url.openConnection();
InputStream is = c.getInputStream();
boolean foundEnd = false;
Expand Down Expand Up @@ -918,32 +875,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