3434import com .google .common .collect .Sets ;
3535import com .google .common .collect .Sets .SetView ;
3636import com .google .common .collect .Streams ;
37- import com .google .common .io .Files ;
3837import java .io .File ;
3938import java .io .IOException ;
39+ import java .nio .charset .StandardCharsets ;
40+ import java .nio .file .Files ;
41+ import java .nio .file .Path ;
4042import java .util .ArrayList ;
4143import java .util .HashMap ;
4244import java .util .List ;
4648import java .util .concurrent .TimeUnit ;
4749import java .util .regex .Matcher ;
4850import java .util .regex .Pattern ;
49- import org .apache .commons .codec .Charsets ;
5051import org .eclipse .aether .RepositorySystem ;
5152import org .eclipse .aether .artifact .Artifact ;
5253import org .eclipse .aether .artifact .DefaultArtifact ;
@@ -108,7 +109,7 @@ public static void main(String[] arguments)
108109 ReleaseNoteGeneration generation = new ReleaseNoteGeneration ();
109110 String report = generation .generateReport (bom , googleCloudJavaVersion );
110111
111- Files .asCharSink ( new File (RELEASE_NOTE_FILE_NAME ), Charsets . UTF_8 ). write ( report );
112+ Files .writeString ( Path . of (RELEASE_NOTE_FILE_NAME ), report );
112113 System .out .println ("Wrote " + RELEASE_NOTE_FILE_NAME );
113114 }
114115
@@ -645,7 +646,7 @@ static String fetchReleaseNote(String owner, String repository, String tag)
645646 throws IOException , InterruptedException {
646647 // gh release --repo googleapis/java-storage view v2.16.0
647648
648- File tempFile = java . nio . file . Files .createTempFile ("gh-release-notes" , ".txt" ).toFile ();
649+ File tempFile = Files .createTempFile ("gh-release-notes" , ".txt" ).toFile ();
649650 tempFile .deleteOnExit ();
650651
651652 Process process = null ;
@@ -661,10 +662,7 @@ static String fetchReleaseNote(String owner, String repository, String tag)
661662 throw new IOException ("The process timed out" );
662663 }
663664
664- String output =
665- new String (
666- java .nio .file .Files .readAllBytes (tempFile .toPath ()),
667- java .nio .charset .StandardCharsets .UTF_8 );
665+ String output = new String (Files .readAllBytes (tempFile .toPath ()), StandardCharsets .UTF_8 );
668666
669667 if (process .exitValue () != 0 ) {
670668 String trimmedOutput = output .trim ();
0 commit comments