本文整理了Java中org.restlet.data.Reference.getExtensions
方法的一些代码示例,展示了Reference.getExtensions
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.getExtensions
方法的具体详情如下:
包路径:org.restlet.data.Reference
类名称:Reference
方法名:getExtensions
[英]Returns the optional extensions for hierarchical identifiers. An extensions part starts after the first '.' character of the last path segment and ends with either the end of the segment of with the first ';' character (matrix start). It is a token similar to file extensions separated by '.' characters. The value can be ommited.
Note that no URI decoding is done by this method.
[中]返回分层标识符的可选扩展名。扩展部分在第一个“.”之后开始最后一个路径段的字符,并以第一个“;”结束角色(矩阵开始)。它是一个类似于以“.”分隔的文件扩展名的标记角色。该值可以被复制。
请注意,此方法不会执行URI解码。
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
/**
* Get the request URI extension. The returned string includes any
* extensions remove during request pre-processing for the purposes of
* URI-based content negotiation. E.g. if the request URI was:
*
* <pre>
* http://example.com/resource.xml.en
* </pre>
*
* this method would return "xml.en" even if an applications implementation
* of {@link ApplicationConfig#getMediaTypeMappings()} returned a map that
* included "xml" as a key
*
* @return the request URI extension
* @see javax.ws.rs.core.UriInfo#getConnegExtension()
*/
public String getConnegExtension() {
return referenceOriginal.getExtensions();
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Returns the extensions as an array or null if no extension is found.
*
* @return The extensions as an array or null if no extension is found.
* @see #getExtensions()
*/
public String[] getExtensionsAsArray() {
String[] result = null;
final String extensions = getExtensions();
if (extensions != null) {
result = extensions.split("\\.");
}
return result;
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Returns the extensions as an array or null if no extension is found.
*
* @return The extensions as an array or null if no extension is found.
* @see #getExtensions()
*/
public String[] getExtensionsAsArray() {
String[] result = null;
final String extensions = getExtensions();
if (extensions != null) {
result = extensions.split("\\.");
}
return result;
}
代码示例来源:origin: org.restlet/org.restlet
/**
* Returns the extensions as an array or null if no extension is found.
*
* @return The extensions as an array or null if no extension is found.
* @see #getExtensions()
*/
public String[] getExtensionsAsArray() {
String[] result = null;
final String extensions = getExtensions();
if (extensions != null) {
result = extensions.split("\\.");
}
return result;
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
private ExtendedUriBuilder createExtendedUriBuilder(Reference ref) {
ExtendedUriBuilder b = new ExtendedUriBuilder();
fillUriBuilder(ref, b);
String extension = ref.getExtensions();
b.extension(extension);
return b;
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
@Override
protected int beforeHandle( Request request, Response response )
{
String extensions = request.getResourceRef().getExtensions();
if ( extensions != null ) {
int idx = extensions.lastIndexOf( '.' );
if ( idx != -1 ) {
extensions = extensions.substring( idx + 1 );
}
MetadataService metadataService = getApplication().getMetadataService();
Metadata metadata = metadataService.getMetadata( extensions );
if ( metadata instanceof MediaType ) {
request.getClientInfo().setAcceptedMediaTypes( Collections.singletonList( new Preference<MediaType>( ( MediaType ) metadata ) ) );
String path = request.getResourceRef().getPath();
path = path.substring( 0, path.length() - extensions.length() - 1 );
request.getResourceRef().setPath( path );
}
}
return Filter.CONTINUE;
}
代码示例来源:origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server
String extensions = request.getResourceRef().getExtensions();
if( extensions != null )
代码示例来源:origin: apache/attic-polygene-java
return Filter.CONTINUE;
String extensions = request.getResourceRef().getExtensions();
if( extensions != null )
代码示例来源:origin: org.qi4j.library/org.qi4j.library.rest-server
String extensions = request.getResourceRef().getExtensions();
if( extensions != null )
代码示例来源:origin: apache/attic-polygene-java
String extensions = request.getResourceRef().getExtensions();
if( extensions != null )
代码示例来源:origin: org.restlet.osgi/org.restlet
boolean mediaTypeFound = false;
boolean languageFound = false;
String extensions = resourceRef.getExtensions();
内容来源于网络,如有侵权,请联系作者删除!