Skip to content

Commit 96b8c16

Browse files
committed
remove URLType
1 parent 4a1461b commit 96b8c16

2 files changed

Lines changed: 0 additions & 33 deletions

File tree

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.io.IOException;
3838
import java.io.InputStream;
3939
import java.io.InputStreamReader;
40-
import java.io.UncheckedIOException;
4140
import java.net.MalformedURLException;
4241
import java.net.URI;
4342
import java.net.URISyntaxException;
@@ -68,12 +67,6 @@ public class Location {
6867
private static final boolean IS_WINDOWS =
6968
System.getProperty("os.name").startsWith("Windows");
7069

71-
// -- Enumerations --
72-
protected enum UrlType {
73-
GENERIC,
74-
S3
75-
};
76-
7770
// -- Static fields --
7871

7972
/** Map from given filenames to actual filenames. */
@@ -113,7 +106,6 @@ protected class ListingsResult {
113106
// -- Fields --
114107

115108
private boolean isURL = false;
116-
private UrlType urlType;
117109
private URL url;
118110
private URI uri;
119111
private File file;
@@ -203,15 +195,13 @@ public Location(String parent, String child) {
203195
pathname = child;
204196
uri = new URI(mapped);
205197
isURL = true;
206-
urlType = UrlType.GENERIC;
207198
url = uri.toURL();
208199
}
209200
catch (URISyntaxException | MalformedURLException e) {
210201
// Readers such as FilePatternReader may pass invalid URI paths
211202
// containing <> so don't throw, instead treat as a non-URL
212203
LOGGER.debug("Invalid URL: {} {}", child, e);
213204
isURL = false;
214-
urlType = null;
215205
url = null;
216206
uri = null;
217207
}
@@ -554,18 +544,6 @@ public String[] list(boolean noHiddenFiles) {
554544
final List<String> files = new ArrayList<String>();
555545
if (isURL) {
556546
try {
557-
if (urlType == UrlType.S3) {
558-
if (isDirectory()) {
559-
// TODO: This is complicated, not sure what to do here
560-
// See comment in isDirectory()
561-
LOGGER.trace("list s3 {}: Returning []", uri);
562-
return new String[0];
563-
}
564-
else {
565-
LOGGER.trace("list s3 {}: Returning null", uri);
566-
return null;
567-
}
568-
}
569547
URLConnection c = url.openConnection();
570548
InputStream is = c.getInputStream();
571549
boolean foundEnd = false;

src/main/java/loci/common/StreamHandle.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,6 @@
5252
*/
5353
public abstract class StreamHandle implements IRandomAccess {
5454

55-
// TODO: Decide how to handle S3Handle and other reader settings
56-
public static class Settings {
57-
public String get(String key) {
58-
return System.getenv(key);
59-
}
60-
61-
public String getRemoteCacheRootDir() {
62-
return get("BF_REMOTE_CACHE_ROOTDIR");
63-
}
64-
}
65-
6655
private static final Logger LOGGER = LoggerFactory.getLogger(StreamHandle.class);
6756

6857
// -- Fields --

0 commit comments

Comments
 (0)