1717
1818import static org .raml .parser .tagresolver .IncludeResolver .INCLUDE_APPLIED_TAG ;
1919
20+ import java .io .File ;
2021import java .util .ArrayDeque ;
2122import java .util .Deque ;
2223
@@ -70,7 +71,7 @@ public static String resolveAbsolutePath(String relativeFile, String parentPath)
7071
7172 public String resolveAbsolutePath (String relativeFile )
7273 {
73- return resolveAbsolutePath (relativeFile , getPartentPath ());
74+ return resolveAbsolutePath (relativeFile , getParentPath ());
7475 }
7576
7677 /**
@@ -91,25 +92,25 @@ public String resolveRelativePath(Tag tag)
9192 {
9293 throw new IllegalArgumentException ("Tag must be an include applied" );
9394 }
94- String partentPath = getPartentPath ();
95+ String parentPath = getParentPath ();
9596 String includePath = new IncludeInfo (tag ).getIncludeName ();
9697
97- if (includePath .startsWith (partentPath ))
98+ if (includePath .startsWith (parentPath ))
9899 {
99- includePath = includePath .substring (partentPath .length ());
100+ includePath = includePath .substring (parentPath .length ());
100101 }
101102 return includePath ;
102103 }
103104
104- public static String getPartentPath (String path )
105+ public static String getParentPath (String path )
105106 {
106- int idx = path .lastIndexOf ("/" ) + 1 ;
107+ int idx = path .lastIndexOf (File . separatorChar ) + 1 ;
107108 return path .substring (0 , idx );
108109 }
109110
110- private String getPartentPath ()
111+ private String getParentPath ()
111112 {
112- return getPartentPath (includeStack .peek ().getIncludeName ());
113+ return getParentPath (includeStack .peek ().getIncludeName ());
113114 }
114115
115116 public IncludeInfo peek ()
@@ -129,7 +130,7 @@ public void push(IncludeInfo includeInfo)
129130
130131 public void push (ScalarNode node )
131132 {
132- push (new IncludeInfo (node , getPartentPath ()));
133+ push (new IncludeInfo (node , getParentPath ()));
133134 }
134135
135136 public void push (Tag tag )
0 commit comments