@@ -70,26 +70,26 @@ public static boolean isAnchor(String ref) {
7070
7171 public static String readURI (String absoluteUri , List <AuthorizationValue > auths ) throws Exception {
7272 URI resolved = new URI (absoluteUri );
73- if (StringUtils .isBlank (resolved .getScheme ())) {
74- // try file
75- String content = null ;
76- try {
77- content = readFile (absoluteUri );
78- } catch ( Exception e ) {
79- //
73+ if (StringUtils .isNotBlank (resolved .getScheme ())) {
74+ if ( resolved . getScheme (). startsWith ( "http" )) {
75+ return readHttp ( absoluteUri , auths ) ;
76+ } else if ( resolved . getScheme (). startsWith ( "file" )) {
77+ return readFile (absoluteUri );
78+ } else if ( resolved . getScheme (). startsWith ( "classpath" ) ) {
79+ return readClasspath ( absoluteUri );
8080 }
81- if (StringUtils .isBlank (content )) {
82- content = readClasspath (absoluteUri );
83- }
84- return content ;
85- } else if (resolved .getScheme ().startsWith ("http" )) {
86- return readHttp (absoluteUri , auths );
87- } else if (resolved .getScheme ().startsWith ("file" )) {
88- return readFile (absoluteUri );
89- } else if (resolved .getScheme ().startsWith ("classpath" )) {
90- return readClasspath (absoluteUri );
9181 }
92- throw new RuntimeException ("scheme not supported for uri: " + absoluteUri );
82+ // If no matches exists, try file
83+ String content = null ;
84+ try {
85+ content = readFile (absoluteUri );
86+ } catch (Exception e ) {
87+ //
88+ }
89+ if (StringUtils .isBlank (content )) {
90+ content = readClasspath (absoluteUri );
91+ }
92+ return content ;
9393 }
9494
9595 public static JsonNode deserializeIntoTree (String content ) throws Exception {
0 commit comments