File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/main/java/org/utplsql/cli Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,26 @@ public class ConnectionConfig {
1010 private final String connect ;
1111
1212 public ConnectionConfig ( String connectString ) {
13- Matcher m = Pattern .compile ("^([^/]+)/([^@]+)@(.*)$" ).matcher (connectString );
13+ Matcher m = Pattern .compile ("^(\" .+ \" | [^/]+)/(\" .+ \" | [^@]+)@(.*)$" ).matcher (connectString );
1414 if ( m .find () ) {
15- user = m .group (1 );
16- password = m .group (2 );
15+ user = stripEnclosingQuotes ( m .group (1 ) );
16+ password = stripEnclosingQuotes ( m .group (2 ) );
1717 connect = m .group (3 );
1818 }
1919 else
2020 throw new IllegalArgumentException ("Not a valid connectString: '" + connectString + "'" );
2121 }
2222
23+ private String stripEnclosingQuotes ( String value ) {
24+ if ( value .length () > 1
25+ && value .startsWith ("\" " )
26+ && value .endsWith ("\" " )) {
27+ return value .substring (1 , value .length ()-1 );
28+ } else {
29+ return value ;
30+ }
31+ }
32+
2333 public String getConnect () {
2434 return connect ;
2535 }
You can’t perform that action at this time.
0 commit comments