本文整理了Java中org.restlet.data.Reference.clone
方法的一些代码示例,展示了Reference.clone
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.clone
方法的具体详情如下:
包路径:org.restlet.data.Reference
类名称:Reference
方法名:clone
暂无
代码示例来源:origin: internetarchive/heritrix3
pw.println("<input type='submit' value='save changes' id='savebutton'>");
pw.println(fileRepresentation.getFile());
Reference viewRef = dirResource.getRequest().getOriginalRef().clone();
viewRef.setQuery(null);
pw.println("<a href='"+viewRef+"'>view</a>");
代码示例来源:origin: internetarchive/heritrix3
/**
* Construct navigational URI for given parameters.
*
* @param pos desired position in file
* @param lines desired signed line count
* @param reverse if line ordering should be displayed in reverse
* @return String URI appropriate to navigate to desired view
*/
protected String getControlUri(long pos, int lines, boolean reverse) {
Form query = new Form();
query.add("format","paged");
if(pos!=0) {
query.add("pos", Long.toString(pos));
}
if(lines!=128) {
if(Math.abs(lines)<1) {
lines = 1;
}
query.add("lines",Integer.toString(lines));
}
if(reverse) {
query.add("reverse","y");
}
Reference viewRef = dirResource.getRequest().getOriginalRef().clone();
viewRef.setQuery(query.getQueryString());
return viewRef.toString();
}
}
代码示例来源:origin: internetarchive/heritrix3
Reference ref = getRequest().getOriginalRef().clone();
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public CaX509UriBuilder x509()
{
return new CaX509UriBuilder( root.clone().addSegment( "x509" ), null, null );
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public CaCaUriBuilder ca()
{
return new CaCaUriBuilder( root.clone().addSegment( "ca" ), null, null );
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public CaToolsUriBuilder tools()
{
return new CaToolsUriBuilder( root.clone().addSegment( "tools" ), null, null );
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public CaEscrowedKeyPairUriBuilder escrowedKeyPair()
{
return new CaEscrowedKeyPairUriBuilder( root.clone().addSegment( "escrow" ), null, null );
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public CaX509ProfileUriBuilder x509Profile()
{
return new CaX509ProfileUriBuilder( root.clone().addSegment( "x509Profile" ), null, null );
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public CaCryptoStoreUriBuilder cryptoStore()
{
return new CaCryptoStoreUriBuilder( root.clone().addSegment( "cryptostore" ), null, null );
}
代码示例来源:origin: apache/attic-polygene-java
@Override
public void write( Writer buf )
throws IOException
{
PrintWriter out = new PrintWriter( buf );
out.println( "<html><head><title>All entities</title></head><body><h1>All entities</h1><ul>" );
query.forEach( entity -> out.println( "<li><a href=\""
+ getRequest().getResourceRef().clone().addSegment( entity.identity() + ".html" )
+ "\">" + entity.identity() + "</a></li>" ) );
out.println( "</ul></body></html>" );
}
};
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public Reference clone() {
final Reference newRef = new Reference();
if (this.baseRef == null) {
newRef.baseRef = null;
} else if (equals(this.baseRef)) {
newRef.baseRef = newRef;
} else {
newRef.baseRef = this.baseRef.clone();
}
newRef.fragmentIndex = this.fragmentIndex;
newRef.internalRef = this.internalRef;
newRef.queryIndex = this.queryIndex;
newRef.schemeIndex = this.schemeIndex;
return newRef;
}
代码示例来源:origin: org.restlet/org.restlet
@Override
public Reference clone() {
final Reference newRef = new Reference();
if (this.baseRef == null) {
newRef.baseRef = null;
} else if (equals(this.baseRef)) {
newRef.baseRef = newRef;
} else {
newRef.baseRef = this.baseRef.clone();
}
newRef.fragmentIndex = this.fragmentIndex;
newRef.internalRef = this.internalRef;
newRef.queryIndex = this.queryIndex;
newRef.schemeIndex = this.schemeIndex;
return newRef;
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
@Override
public Reference clone() {
final Reference newRef = new Reference();
if (this.baseRef == null) {
newRef.baseRef = null;
} else if (equals(this.baseRef)) {
newRef.baseRef = newRef;
} else {
newRef.baseRef = this.baseRef.clone();
}
newRef.fragmentIndex = this.fragmentIndex;
newRef.internalRef = this.internalRef;
newRef.queryIndex = this.queryIndex;
newRef.schemeIndex = this.schemeIndex;
return newRef;
}
代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http
public final String build()
{
if ( "factory".equals( special ) ) {
return baseRef.clone().addSegment( "factory" ).toString();
}
if ( Strings.isEmpty( identity ) ) {
if ( !Strings.isEmpty( special ) ) {
return baseRef.clone().addSegment( special ).toString();
}
return baseRef.toString();
}
if ( Strings.isEmpty( special ) ) {
return baseRef.clone().addSegment( identity ).toString();
}
return baseRef.clone().addSegment( identity ).addSegment( special ).toString();
}
代码示例来源:origin: apache/attic-polygene-java
public synchronized ContextResourceClient newClient( String relativePath )
{
if( relativePath.startsWith( "http://" ) )
{
return contextResourceFactory.newClient( new Reference( relativePath ) );
}
Reference reference = this.reference.clone();
if( relativePath.startsWith( "/" ) )
{
reference.setPath( relativePath );
}
else
{
reference.setPath( reference.getPath() + relativePath );
reference = reference.normalize();
}
return contextResourceFactory.newClient( reference );
}
代码示例来源:origin: apache/attic-polygene-java
if( tag != null )
Reference ref = response.getRequest().getResourceRef().clone();
代码示例来源:origin: org.archive.heritrix/heritrix-engine
/**
* Construct navigational URI for given parameters.
*
* @param pos desired position in file
* @param lines desired signed line count
* @param reverse if line ordering should be displayed in reverse
* @return String URI appropriate to navigate to desired view
*/
protected String getControlUri(long pos, int lines, boolean reverse) {
Form query = new Form();
query.add("format","paged");
if(pos!=0) {
query.add("pos", Long.toString(pos));
}
if(lines!=128) {
if(Math.abs(lines)<1) {
lines = 1;
}
query.add("lines",Integer.toString(lines));
}
if(reverse) {
query.add("reverse","y");
}
Reference viewRef = dirResource.getRequest().getOriginalRef().clone();
viewRef.setQuery(query.getQueryString());
return viewRef.toString();
}
}
代码示例来源:origin: org.archive.heritrix/heritrix-engine
Reference ref = getRequest().getOriginalRef().clone();
代码示例来源:origin: apache/attic-polygene-java
private Representation representAtom()
throws ResourceException
{
try
{
Feed feed = new Feed();
feed.setTitle( new Text( MediaType.TEXT_PLAIN, "All entities" ) );
List<Entry> entries = feed.getEntries();
entityFinder.findEntities( EntityComposite.class, null, null, null, null, Collections.emptyMap() )
.forEach(
entityReference ->
{
Entry entry = new Entry();
entry.setTitle( new Text( MediaType.TEXT_PLAIN, entityReference.toString() ) );
Link link = new Link();
link.setHref( getRequest().getResourceRef().clone()
.addSegment( entityReference.identity().toString() ) );
entry.getLinks().add( link );
entries.add( entry );
} );
return feed;
}
catch( Exception e )
{
throw new ResourceException( e );
}
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl
public void handle(Request request, Response response) {
Reference rr = request.getResourceRef().clone();
内容来源于网络,如有侵权,请联系作者删除!