Created
March 17, 2016 10:11
-
-
Save yyamano/6419f409c0cbf11ee3b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/org/raml/parser/loader/FileResourceLoader.java b/src/main/java/org/raml/parser/loader/FileResourceLoader.java | |
index 5ec1e11..883b5bd 100644 | |
--- a/src/main/java/org/raml/parser/loader/FileResourceLoader.java | |
+++ b/src/main/java/org/raml/parser/loader/FileResourceLoader.java | |
@@ -42,12 +42,15 @@ public class FileResourceLoader implements ResourceLoader | |
@Override | |
public InputStream fetchResource(String resourceName) | |
{ | |
- File includedFile = new File(parentPath, resourceName); | |
+ File includedFile = new File(resourceName); | |
+ if (!includedFile.isAbsolute()) { | |
+ includedFile = new File(parentPath, resourceName); | |
+ if (logger.isDebugEnabled()) | |
+ { | |
+ logger.debug(String.format("Looking for resource: %s on directory: %s...", resourceName, parentPath)); | |
+ } | |
+ } | |
FileInputStream inputStream = null; | |
- if (logger.isDebugEnabled()) | |
- { | |
- logger.debug(String.format("Looking for resource: %s on directory: %s...", resourceName, parentPath)); | |
- } | |
try | |
{ | |
return new FileInputStream(includedFile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment