当前位置: 首页>>代码示例>>Java>>正文


Java UriInfo.getRequestUri方法代码示例

本文整理汇总了Java中javax.ws.rs.core.UriInfo.getRequestUri方法的典型用法代码示例。如果您正苦于以下问题:Java UriInfo.getRequestUri方法的具体用法?Java UriInfo.getRequestUri怎么用?Java UriInfo.getRequestUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.ws.rs.core.UriInfo的用法示例。


在下文中一共展示了UriInfo.getRequestUri方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: davPropFind

import javax.ws.rs.core.UriInfo; //导入方法依赖的package包/类
protected javax.ws.rs.core.Response davPropFind(Long id, UriInfo uriInfo, String depth, Providers providers) throws AuthenticationException, AuthorisationException,
ServiceException {
	final Response folder = new Response(new HRef(uriInfo.getRequestUri()), null, null, null, new PropStat(new Prop(new DisplayName("My Collection"),
			new CreationDate(new Date()), new GetLastModified(new Date()), COLLECTION), new Status((StatusType) OK)));
	if (depth.equals(DEPTH_0) || id == null) {
		return javax.ws.rs.core.Response.status(MULTI_STATUS).entity(new MultiStatus(folder)).build();
	}
	final Collection<Response> responses = new LinkedList<Response>(singletonList(folder));
	Iterator<FileOutVO> it = WebUtil.getServiceLocator().getFileService().getFiles(getAuth(), getFileModule(), id, null, null, null).iterator();
	if (it != null) {
		while (it.hasNext()) {
			FileOutVO out = it.next();
			// responses.add(buildResponse(f, uriInfo.getAbsolutePathBuilder().path(format("%s", c.getMatchCode())).build(), providers));
			FilePathSplitter filePath = new FilePathSplitter(out.getFileName());
			String extension = filePath.getExtension();
			if (isTempFile(extension) || isEditableFile(extension)) {
				responses.add(buildResponse(out, uriInfo.getAbsolutePathBuilder().path(getDavFileName(out)).build(), providers));
			}
		}
	}
	return javax.ws.rs.core.Response.status(MULTI_STATUS).entity(new MultiStatus(responses.toArray(new Response[0]))).build();
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:23,代码来源:FileDavResourceBase.java

示例2: load

import javax.ws.rs.core.UriInfo; //导入方法依赖的package包/类
/**
 * Load cell info.
 * @param uriInfo UriInfo
 * @return CellObject. If Cell does not exist, it returns null.
 */
public static Cell load(UriInfo uriInfo) {
    URI reqUri = uriInfo.getRequestUri();
    URI baseUri = uriInfo.getBaseUri();

    String rPath = reqUri.getPath();
    String bPath = baseUri.getPath();
    rPath = rPath.substring(bPath.length());
    String[] paths = StringUtils.split(rPath, "/");

    CellEsImpl cell = (CellEsImpl) findCell("s.Name.untouched", paths[0]);
    if (cell != null) {
        cell.url = getBaseUri(uriInfo, cell.name);
        cell.owner = UriUtils.convertSchemeFromLocalUnitToHttp(cell.getUnitUrl(), cell.owner);
    }
    return cell;
}
 
开发者ID:personium,项目名称:personium-core,代码行数:22,代码来源:CellEsImpl.java

示例3: withUriInfo

import javax.ws.rs.core.UriInfo; //导入方法依赖的package包/类
/**
 * Creates a shallow copy of the swagger but set the schemes, host and base path
 * based on {@link UriInfo}.
 *
 * @param uriInfo
 *            URI info of the request.
 * @return shallow copy
 */
public ClonableSwagger withUriInfo(final UriInfo uriInfo) {

    final ClonableSwagger copy = new ClonableSwagger();
    copy.swagger = swagger;
    copy.info = info;
    final URI requestUri = uriInfo.getRequestUri();
    if (requestUri.getPort() != -1) {
        copy.host = requestUri.getHost() + ":" + requestUri.getPort();
    } else {
        copy.host = requestUri.getHost();
    }
    copy.basePath = basePath;
    copy.tags = tags;

    copy.schemes = Collections.singletonList(Scheme.forValue(requestUri.getScheme()));

    copy.consumes = consumes;
    copy.produces = produces;
    copy.security = security;
    copy.paths = paths;
    copy.securityDefinitions = securityDefinitions;
    copy.definitions = definitions;
    copy.parameters = parameters;
    copy.responses = responses;
    copy.externalDocs = externalDocs;
    copy.vendorExtensions = vendorExtensions;
    return copy;
}
 
开发者ID:trajano,项目名称:app-ms,代码行数:37,代码来源:ClonableSwagger.java


注:本文中的javax.ws.rs.core.UriInfo.getRequestUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。