Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ public class S3Credentials {
* to talk to them.
*/
public void initialize(URI uri, Configuration conf) throws IOException {
if (uri.getHost() == null) {
throw new IllegalArgumentException("Invalid hostname in URI " + uri);
}
// How can the s3 url have a host?
if (uri.getAuthority() == null) {
throw new IllegalArgumentException("Invalid hostname in URI " + uri);
}

String userInfo = uri.getUserInfo();
if (userInfo != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void initialize(URI uri, Configuration conf) throws IOException {
MAX_PART_SIZE);
serverSideEncryptionAlgorithm = conf.get("fs.s3n.server-side-encryption-algorithm");

bucket = new S3Bucket(uri.getHost());
bucket = new S3Bucket(uri.getAuthority());
}

@Override
Expand Down