S3ResourceId implements ResourceId { static S3ResourceId fromUri(String uri) { Matcher m = S3_URI.matcher(uri); checkArgument(m.matches(), "Invalid S3 URI: [%s]", uri); checkArgument(m.group("SCHEME").equalsIgnoreCase(SCHEME), "Invalid S3 URI scheme: [%s]", uri); String bucket = m.group("BUCKET"); String key = Strings.nullToEmpty(m.group("KEY")); if (!key.startsWith("/")) { key = "/" + key; } return fromComponents(bucket, key); } private  S3ResourceId(
      String bucket, String key, @Nullable Long size, @Nullable Date lastModified); @Override ResourceId resolve(String other, ResolveOptions resolveOptions); @Override ResourceId getCurrentDirectory(); @Override String getScheme(); @Nullable @Override String getFilename(); @Override boolean isDirectory(); @Override String toString(); @Override boolean equals(@Nullable Object obj); @Override int hashCode();  }
@Test public void testInvalidPathNoBucket() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Invalid S3 URI: [s3: S3ResourceId.fromUri("s3: }
@Test public void testInvalidPathNoBucketAndSlash() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Invalid S3 URI: [s3: S3ResourceId.fromUri("s3: }
@Test public void testInvalidS3ResourceId() { thrown.expect(IllegalArgumentException.class); S3ResourceId.fromUri("file: }
@Test public void testResourceIdTester() { S3Options options = PipelineOptionsFactory.create().as(S3Options.class); options.setAwsRegion("us-west-1"); FileSystems.setDefaultPipelineOptions(options); ResourceIdTester.runResourceIdBattery(S3ResourceId.fromUri("s3: }