File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/main/java/org/utplsql/cli Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 22
33import org .utplsql .api .JavaApiVersionInfo ;
44
5+ import java .io .BufferedReader ;
56import java .io .IOException ;
7+ import java .io .InputStream ;
8+ import java .io .InputStreamReader ;
69import java .net .URISyntaxException ;
7- import java .nio .charset .Charset ;
8- import java .nio .file .Files ;
9- import java .nio .file .Paths ;
1010
1111/** This class is getting updated automatically by the build process.
1212 * Please do not update its constants manually cause they will be overwritten.
@@ -20,12 +20,14 @@ public class CliVersionInfo {
2020
2121 static {
2222 try {
23- MAVEN_PROJECT_VERSION = Files .readAllLines (
24- Paths .get (CliVersionInfo .class .getClassLoader ().getResource ("utplsql-cli.version" ).toURI ())
25- , Charset .defaultCharset ())
26- .get (0 );
23+ try ( InputStream in = JavaApiVersionInfo .class .getClassLoader ().getResourceAsStream ("utplsql-cli.version" )) {
24+ BufferedReader reader = new BufferedReader (new InputStreamReader (in ));
25+ MAVEN_PROJECT_VERSION = reader .readLine ();
26+
27+ reader .close ();
28+ }
2729 }
28- catch ( IOException | URISyntaxException e ) {
30+ catch ( IOException e ) {
2931 System .out .println ("WARNING: Could not get Version information!" );
3032 }
3133 }
You can’t perform that action at this time.
0 commit comments