org.restlet.data.Reference.getSegments()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.restlet.data.Reference.getSegments方法的一些代码示例,展示了Reference.getSegments的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.getSegments方法的具体详情如下:
包路径:org.restlet.data.Reference
类名称:Reference
方法名:getSegments

Reference.getSegments介绍

[英]Returns the list of segments in a hierarchical path.
A new list is created for each call.
Note that no URI decoding is done by this method.
[中]返回分层路径中的段列表。
每次通话都会创建一个新列表。
请注意,此方法不会执行URI解码。

代码示例

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Returns the optionnally decoded list of segments.
 * 
 * @param decode
 *            Indicates if the result should be decoded using the {@link #decode(String)} method.
 * @return The optionnally decoded list of segments.
 * @see #getSegments()
 */
public List<String> getSegments(boolean decode) {
  final List<String> result = getSegments();
  if (decode) {
    for (int i = 0; i < result.size(); i++) {
      result.set(i, decode(result.get(i)));
    }
  }
  return result;
}

代码示例来源:origin: org.restlet/org.restlet

/**
 * Returns the optionnally decoded list of segments.
 * 
 * @param decode
 *            Indicates if the result should be decoded using the
 *            {@link #decode(String)} method.
 * @return The optionnally decoded list of segments.
 * @see #getSegments()
 */
public List<String> getSegments(boolean decode) {
  final List<String> result = getSegments();
  if (decode) {
    for (int i = 0; i < result.size(); i++) {
      result.set(i, decode(result.get(i)));
    }
  }
  return result;
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Returns the optionnally decoded list of segments.
 * 
 * @param decode
 *            Indicates if the result should be decoded using the
 *            {@link #decode(String)} method.
 * @return The optionnally decoded list of segments.
 * @see #getSegments()
 */
public List<String> getSegments(boolean decode) {
  final List<String> result = getSegments();
  if (decode) {
    for (int i = 0; i < result.size(); i++) {
      result.set(i, decode(result.get(i)));
    }
  }
  return result;
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs

/**
 * Creates an unmodifiable List of {@link PathSegment}s.
 * 
 * @param decode
 *            indicates, if the values should be decoded or not
 * @return
 */
private List<PathSegment> createPathSegments(boolean decode) {
  List<String> segmentsEnc;
  segmentsEnc = this.referenceOriginal.getRelativeRef().getSegments();
  final int l = segmentsEnc.size();
  final List<PathSegment> pathSegments = new ArrayList<PathSegment>(l);
  for (int i = 0; i < l; i++) {
    final String segmentEnc = segmentsEnc.get(i);
    pathSegments.add(new PathSegmentImpl(segmentEnc, decode, i));
  }
  return Collections.unmodifiableList(pathSegments);
}

代码示例来源:origin: org.sonatype.nexus.plugins/nexus-yum-repository-plugin

public UrlPathInterpretation parse(Request request)
  throws ResourceException
 final List<String> segments = request.getResourceRef().getSegments();
 final int yumIndex = segments.indexOf(segmentPrefix);
 if (yumIndex < 0) {

代码示例来源:origin: apache/attic-polygene-java

@Override
protected int beforeHandle( Request request, Response response )
  List<String> segments = request.getResourceRef().getSegments();
  if (segments.get( segments.size()-1 ).equals(""))
   return Filter.CONTINUE;

代码示例来源:origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

@Override
protected int beforeHandle( Request request, Response response )
  List<String> segments = request.getResourceRef().getSegments();
  if( segments.get( segments.size() - 1 ).equals( "" ) )

代码示例来源:origin: org.qi4j.library/org.qi4j.library.rest-server

@Override
protected int beforeHandle( Request request, Response response )
  List<String> segments = request.getResourceRef().getSegments();
  if( segments.get( segments.size() - 1 ).equals( "" ) )

代码示例来源:origin: apache/attic-polygene-java

@Override
protected int beforeHandle( Request request, Response response )
  List<String> segments = request.getResourceRef().getSegments();
  if( segments.get( segments.size() - 1 ).equals( "" ) )

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-preview-jsf

String xpath = (String) req.getAttributes().get("fieldPath");
xpath = xpath.replace("-", "/");
List<String> segments = req.getResourceRef().getSegments();
StringBuilder sb = new StringBuilder();
int pos = segments.indexOf("restAPI") + 5;

代码示例来源:origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

List<String> segments = ref.getScheme()
              .equals( "riap" ) ? ref.getRelativeRef( new Reference( "riap://application/" ) )
              .getSegments() : ref.getRelativeRef().getSegments();

代码示例来源:origin: org.qi4j.library/org.qi4j.library.rest-server

List<String> segments = ref.getScheme()
              .equals( "riap" ) ? ref.getRelativeRef( new Reference( "riap://application/" ) )
  .getSegments() : ref.getRelativeRef().getSegments();

代码示例来源:origin: apache/attic-polygene-java

List<String> segments = ref.getScheme()
              .equals( "riap" ) ? ref.getRelativeRef( new Reference( "riap://application/" ) )
              .getSegments() : ref.getRelativeRef().getSegments();

相关文章

Reference类方法