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 2
2
3
3
import org .utplsql .api .JavaApiVersionInfo ;
4
4
5
+ import java .io .BufferedReader ;
5
6
import java .io .IOException ;
7
+ import java .io .InputStream ;
8
+ import java .io .InputStreamReader ;
6
9
import java .net .URISyntaxException ;
7
- import java .nio .charset .Charset ;
8
- import java .nio .file .Files ;
9
- import java .nio .file .Paths ;
10
10
11
11
/** This class is getting updated automatically by the build process.
12
12
* Please do not update its constants manually cause they will be overwritten.
@@ -20,12 +20,14 @@ public class CliVersionInfo {
20
20
21
21
static {
22
22
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
+ }
27
29
}
28
- catch ( IOException | URISyntaxException e ) {
30
+ catch ( IOException e ) {
29
31
System .out .println ("WARNING: Could not get Version information!" );
30
32
}
31
33
}
You can’t perform that action at this time.
0 commit comments