|
37 | 37 | import java.io.IOException; |
38 | 38 | import java.io.InputStream; |
39 | 39 | import java.io.InputStreamReader; |
40 | | -import java.io.UncheckedIOException; |
41 | 40 | import java.net.MalformedURLException; |
42 | 41 | import java.net.URI; |
43 | 42 | import java.net.URISyntaxException; |
@@ -68,12 +67,6 @@ public class Location { |
68 | 67 | private static final boolean IS_WINDOWS = |
69 | 68 | System.getProperty("os.name").startsWith("Windows"); |
70 | 69 |
|
71 | | - // -- Enumerations -- |
72 | | - protected enum UrlType { |
73 | | - GENERIC, |
74 | | - S3 |
75 | | - }; |
76 | | - |
77 | 70 | // -- Static fields -- |
78 | 71 |
|
79 | 72 | /** Map from given filenames to actual filenames. */ |
@@ -113,7 +106,6 @@ protected class ListingsResult { |
113 | 106 | // -- Fields -- |
114 | 107 |
|
115 | 108 | private boolean isURL = false; |
116 | | - private UrlType urlType; |
117 | 109 | private URL url; |
118 | 110 | private URI uri; |
119 | 111 | private File file; |
@@ -203,15 +195,13 @@ public Location(String parent, String child) { |
203 | 195 | pathname = child; |
204 | 196 | uri = new URI(mapped); |
205 | 197 | isURL = true; |
206 | | - urlType = UrlType.GENERIC; |
207 | 198 | url = uri.toURL(); |
208 | 199 | } |
209 | 200 | catch (URISyntaxException | MalformedURLException e) { |
210 | 201 | // Readers such as FilePatternReader may pass invalid URI paths |
211 | 202 | // containing <> so don't throw, instead treat as a non-URL |
212 | 203 | LOGGER.debug("Invalid URL: {} {}", child, e); |
213 | 204 | isURL = false; |
214 | | - urlType = null; |
215 | 205 | url = null; |
216 | 206 | uri = null; |
217 | 207 | } |
@@ -554,18 +544,6 @@ public String[] list(boolean noHiddenFiles) { |
554 | 544 | final List<String> files = new ArrayList<String>(); |
555 | 545 | if (isURL) { |
556 | 546 | 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 | | - } |
569 | 547 | URLConnection c = url.openConnection(); |
570 | 548 | InputStream is = c.getInputStream(); |
571 | 549 | boolean foundEnd = false; |
|
0 commit comments