@@ -171,23 +171,39 @@ public String getInternalUrl() {
171
171
172
172
/**
173
173
* Get the URL directly to the resource
174
- * @param branchOverride The branch to use instead of the one in this instance
174
+ * @param branchOverride The branch to use, or <code>null</code> to use this instance's branch
175
+ * @param pathOverride The path to use, or <code>null</code> to use this instance's path
175
176
* @return The URL
176
177
*/
177
- public String getRawUrl (String branchOverride ) {
178
+ public String getRawUrl (String branchOverride , String pathOverride ) {
179
+ if (branchOverride == null ) {
180
+ branchOverride = branch ;
181
+ }
182
+ if (pathOverride == null ) {
183
+ pathOverride = path ;
184
+ }
178
185
switch (getType ()) {
179
- case GITHUB :
180
- return "https://raw.githubusercontent.com/" +
181
- normaliseUrl (repoUrl ).replace ("github.com/" , "" ).replace (".git" , "" ) +
182
- "/" + branchOverride + "/" + path ;
183
- case GITLAB :
184
- case BITBUCKET :
185
- return "https://" + normaliseUrl (repoUrl ).replace (".git" , "" )
186
- + "/raw/" + branchOverride + "/" + path ;
187
- default :
188
- return repoUrl ;
186
+ case GITHUB :
187
+ return "https://raw.githubusercontent.com/" +
188
+ normaliseUrl (repoUrl ).replace ("github.com/" , "" ).replace (".git" , "" ) +
189
+ "/" + branchOverride + "/" + pathOverride ;
190
+ case GITLAB :
191
+ case BITBUCKET :
192
+ return "https://" + normaliseUrl (repoUrl ).replace (".git" , "" )
193
+ + "/raw/" + branchOverride + "/" + pathOverride ;
194
+ default :
195
+ return repoUrl ;
189
196
}
190
197
}
198
+
199
+ /**
200
+ * Get the URL directly to the resource
201
+ * @param branchOverride The branch to use instead of the one in this instance
202
+ * @return The URL
203
+ */
204
+ public String getRawUrl (String branchOverride ) {
205
+ return getRawUrl (branchOverride , path );
206
+ }
191
207
192
208
/**
193
209
* Get the URL directly to the resource
0 commit comments