gluu
クラス | 公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.xdi.oxauth.model.util.URLPatternList クラス
org.xdi.oxauth.model.util.URLPatternList 連携図
Collaboration graph

クラス

class  URLPattern
 

公開メンバ関数

 URLPatternList ()
 
 URLPatternList (List< String > urlPatternList)
 
boolean isUrlListed (String uri)
 
void addListEntry (String urlPattern)
 

非公開変数類

List< URLPatternurlPatternList
 

静的非公開変数類

static final Logger LOG = Logger.getLogger(URLPatternList.class)
 

詳解

著者
Javier Rojas Blum
バージョン
October 10, 2016

構築子と解体子

◆ URLPatternList() [1/2]

org.xdi.oxauth.model.util.URLPatternList.URLPatternList ( )
inline
22  {
23  this.urlPatternList = new ArrayList<URLPattern>();
24  }
List< URLPattern > urlPatternList
Definition: URLPatternList.java:20

◆ URLPatternList() [2/2]

org.xdi.oxauth.model.util.URLPatternList.URLPatternList ( List< String >  urlPatternList)
inline
26  {
27  this();
28 
29  if (urlPatternList != null) {
30  for (String urlPattern : urlPatternList) {
31  addListEntry(urlPattern);
32  }
33  }
34  }
void addListEntry(String urlPattern)
Definition: URLPatternList.java:52
List< URLPattern > urlPatternList
Definition: URLPatternList.java:20

関数詳解

◆ addListEntry()

void org.xdi.oxauth.model.util.URLPatternList.addListEntry ( String  urlPattern)
inline
52  {
53  if (urlPatternList != null) {
54  try {
55  if (urlPattern.compareTo("*") == 0) {
56  LOG.debug("Unlimited access to network resources");
57  urlPatternList = null;
58  } else { // specific access
59  Pattern parts = Pattern.compile("^((\\*|[A-Za-z-]+):(//)?)?(\\*|((\\*\\.)?[^*/:]+))?(:(\\d+))?(/.*)?");
60  Matcher m = parts.matcher(urlPattern);
61  if (m.matches()) {
62  String scheme = m.group(2);
63  String host = m.group(4);
64  // Special case for two urls which are allowed to have empty hosts
65  if (("file".equals(scheme) || "content".equals(scheme)) && host == null) host = "*";
66  String port = m.group(8);
67  String path = m.group(9);
68  if (scheme == null) {
69  urlPatternList.add(new URLPattern("http", host, port, path));
70  urlPatternList.add(new URLPattern("https", host, port, path));
71  } else {
72  urlPatternList.add(new URLPattern(scheme, host, port, path));
73  }
74  }
75  }
76  } catch (Exception e) {
77  LOG.debug("Failed to add origin " + urlPattern);
78  }
79  }
80  }
List< URLPattern > urlPatternList
Definition: URLPatternList.java:20
static final Logger LOG
Definition: URLPatternList.java:18

◆ isUrlListed()

boolean org.xdi.oxauth.model.util.URLPatternList.isUrlListed ( String  uri)
inline
36  {
37  if (urlPatternList == null) {
38  return true;
39  }
40 
41  URI parsedUri = URI.create(uri);
42 
43  for (URLPattern pattern : urlPatternList) {
44  if (pattern.matches(parsedUri)) {
45  return true;
46  }
47  }
48 
49  return false;
50  }
List< URLPattern > urlPatternList
Definition: URLPatternList.java:20

メンバ詳解

◆ LOG

final Logger org.xdi.oxauth.model.util.URLPatternList.LOG = Logger.getLogger(URLPatternList.class)
staticprivate

◆ urlPatternList

List<URLPattern> org.xdi.oxauth.model.util.URLPatternList.urlPatternList
private

このクラス詳解は次のファイルから抽出されました: