Skip to content

Commit abe3018

Browse files
committed
Implement getName() to ensure format detection works.
1 parent 1b85929 commit abe3018

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/org/scijava/io/http/HTTPLocation.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.net.URI;
3535
import java.net.URISyntaxException;
3636
import java.net.URL;
37+
import java.util.List;
3738
import java.util.Objects;
3839

3940
import org.scijava.io.location.AbstractRemoteLocation;
@@ -136,4 +137,13 @@ public HttpUrl getHttpUrl() {
136137
public URI getURI() {
137138
return url.uri();
138139
}
140+
141+
/**
142+
* @return the last path element
143+
*/
144+
@Override
145+
public String getName() {
146+
final List<String> segs = url.pathSegments();
147+
return segs.get(segs.size() - 1);
148+
}
139149
}

0 commit comments

Comments
 (0)