diff --git a/lib/trino-filesystem/src/main/java/io/trino/filesystem/Location.java b/lib/trino-filesystem/src/main/java/io/trino/filesystem/Location.java index c2dc2c22befd..a09862b4221a 100644 --- a/lib/trino-filesystem/src/main/java/io/trino/filesystem/Location.java +++ b/lib/trino-filesystem/src/main/java/io/trino/filesystem/Location.java @@ -121,11 +121,6 @@ private Location withPath(String location, String path) return new Location(location, scheme, userInfo, host, port, path); } - public String location() - { - return location; - } - /** * Returns the scheme of the location, if present. * If the scheme is present, the value will not be an empty string. @@ -287,6 +282,9 @@ public int hashCode() return location.hashCode(); } + /** + * Return the original location string. + */ @Override public String toString() { diff --git a/lib/trino-filesystem/src/test/java/io/trino/filesystem/TestLocation.java b/lib/trino-filesystem/src/test/java/io/trino/filesystem/TestLocation.java index f853f9f1cd6a..b5b13c47d5e8 100644 --- a/lib/trino-filesystem/src/test/java/io/trino/filesystem/TestLocation.java +++ b/lib/trino-filesystem/src/test/java/io/trino/filesystem/TestLocation.java @@ -156,12 +156,12 @@ private static void assertLocation(String locationString, String path) private static void assertLocation(Location actual, Location expected) { - assertLocation(actual, expected.location(), expected.scheme(), expected.userInfo(), expected.host(), expected.port(), expected.path()); + assertLocation(actual, expected.toString(), expected.scheme(), expected.userInfo(), expected.host(), expected.port(), expected.path()); } private static void assertLocation(Location location, String locationString, Optional scheme, Optional userInfo, Optional host, OptionalInt port, String path) { - assertThat(location.location()).isEqualTo(locationString); + assertThat(location.toString()).isEqualTo(locationString); assertThat(location.scheme()).isEqualTo(scheme); assertThat(location.userInfo()).isEqualTo(userInfo); assertThat(location.host()).isEqualTo(host);