1 package com.atlassian.plugin.webresource;
2
3 import java.util.Map;
4
5
6
7
8
9
10
11 public class SuperBatchSubResource extends SuperBatchPluginResource
12 {
13 public SuperBatchSubResource(String resourceName, String type, Map<String, String> params)
14 {
15 super(resourceName, type, params);
16 }
17
18 public static boolean matches(String path)
19 {
20 return path.indexOf(URL_PREFIX) != -1;
21 }
22
23 public static SuperBatchSubResource parse(String path, Map<String, String> params)
24 {
25 String type = getType(path);
26 int i = path.indexOf('?');
27 if (i != -1)
28 {
29 path = path.substring(0, i);
30 }
31 int startIndex = path.indexOf(URL_PREFIX) + URL_PREFIX.length();
32 String resourceName = path.substring(startIndex);
33 return new SuperBatchSubResource(resourceName, type, params);
34 }
35 }