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


Java AbortWithHttpErrorCodeException类代码示例

本文整理汇总了Java中org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException的典型用法代码示例。如果您正苦于以下问题:Java AbortWithHttpErrorCodeException类的具体用法?Java AbortWithHttpErrorCodeException怎么用?Java AbortWithHttpErrorCodeException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AbortWithHttpErrorCodeException类属于org.apache.wicket.request.http.flow包,在下文中一共展示了AbortWithHttpErrorCodeException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ArtifactListPage

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
public ArtifactListPage() throws IOException {
    setStatelessHint(true);
    setVersioned(false);

    //Retrieve the repository path from the request
    HttpServletRequest httpServletRequest = WicketUtils.getHttpServletRequest();
    RepoPath repoPath = (RepoPath) httpServletRequest.getAttribute(RepoFilter.ATTR_ARTIFACTORY_REPOSITORY_PATH);
    if (repoPath == null || StringUtils.isEmpty(repoPath.getRepoKey())) {
        throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND);
    }

    addTitle(repoPath);
    Properties requestProps = (Properties) httpServletRequest
            .getAttribute(RepoFilter.ATTR_ARTIFACTORY_REQUEST_PROPERTIES);
    addFileList(repoPath, requestProps);
    addAddress(httpServletRequest);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:18,代码来源:ArtifactListPage.java

示例2: getRequestedNodeId

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
protected Long getRequestedNodeId() {
	StringValue id = getPageParameters().get("id");
	if (id.isEmpty()) {
		String key = getPageParameters().get("project-key")
				.toOptionalString();
		if (key != null) {
			ITreeNode<String> node = treeNodeService
					.getTreeNodeByKey(key);
			if (node != null) {
				id = StringValue.valueOf(node.getId());
			} else {
				// TODO give translated message for the 404 reason
				throw new AbortWithHttpErrorCodeException(404);
			}
		}
	}
	return id.toOptionalLong();
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:19,代码来源:HistoricProjectPage.java

示例3: getRequestedNodeId

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
private Long getRequestedNodeId() {
	StringValue id = getPageParameters().get("id");
	if (id.isEmpty()) {
		String key = getPageParameters().get("project-key")
				.toOptionalString();
		if (key != null) {
			ITreeNode<String> node = treeNodeService
					.getTreeNodeByKey(key);
			if (node != null) {
				id = StringValue.valueOf(node.getId());
			} else {
				// TODO give translated message for the 404 reason
				throw new AbortWithHttpErrorCodeException(404);
			}
		}
	}
	return id.toOptionalLong();
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:19,代码来源:BaseTreePage.java

示例4: getRequestedNodeId

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
private Long getRequestedNodeId() {
	StringValue id = getPageParameters().get("id");
	if (id.isEmpty()) {
		String key = getPageParameters().get("qmodel-key")
				.toOptionalString();
		if (key != null) {
			IQMTreeNode<String> node = qmtreeNodeService
					.getTreeNodeByKey(key);
			if (node != null) {
				id = StringValue.valueOf(node.getId());
			} else {
				// TODO give translated message for the 404 reason
				throw new AbortWithHttpErrorCodeException(404);
			}
		}
	}
	return id.toOptionalLong();
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:19,代码来源:QMBaseTreePage.java

示例5: getItems

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
/**
 * sort retrieved browsable item from repository
 * @param repoPath - repository path
 * @param requestProps - request properties
 * @param rootNodesFilterResult - object hold the List node acceptance status flag,if flagged to false meaning
 *                                    at least one node has read permission issue by user
 * @return list of sorted browsable item
 */
private List<? extends BaseBrowsableItem> getItems(RepoPath repoPath, Properties requestProps,
        RootNodesFilterResult rootNodesFilterResult) {
    boolean updateRootNodesFilterFlag = authorizationService.isAnonymous();
    List<? extends BaseBrowsableItem> items;
    try {
        items = getBrowsableItemsList(repoPath, requestProps,rootNodesFilterResult,
                updateRootNodesFilterFlag);
    } catch (Exception e) {
        throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
    }
    Collections.sort(items, new ItemInfoComparator());
    return items;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:22,代码来源:ArtifactListPage.java

示例6: SimpleRepoBrowserPage

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
public SimpleRepoBrowserPage() {
    setStatelessHint(false);
    setVersioned(false);

    //Retrieve the repository path from the request
    HttpServletRequest httpRequest = WicketUtils.getHttpServletRequest();
    RepoPath repoPath = (RepoPath) httpRequest.getAttribute(RepoFilter.ATTR_ARTIFACTORY_REPOSITORY_PATH);
    if (repoPath == null) {
        //Happens on refresh after login redirection - return a 404
        throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND);
    }

    String repoKey = repoPath.getRepoKey();
    RemoteRepoDescriptor remoteRepoDescriptor = repoService.remoteRepoDescriptorByKey(repoKey);
    if (authorizationService.isAdmin() && (remoteRepoDescriptor != null) &&
            !remoteRepoDescriptor.isListRemoteFolderItems()) {
        warn("Remote content browsing is disabled for this repository." +
                "\n You can turn on remote browsing by enabling the 'List Remote Folder Items' flag for this repository.");
    }

    Properties requestProps = (Properties) httpRequest.getAttribute(RepoFilter.ATTR_ARTIFACTORY_REQUEST_PROPERTIES);
    if (repoService.remoteRepoDescriptorByKey(repoKey) != null) {
        add(new RemoteRepoBrowserPanel("browseRepoPanel", repoPath, requestProps));
    } else if (repoService.virtualRepoDescriptorByKey(repoKey) != null) {
        add(new VirtualRepoBrowserPanel("browseRepoPanel", repoPath, requestProps));
    } else if (repoService.localOrCachedRepoDescriptorByKey(repoKey) != null) {
        add(new LocalRepoBrowserPanel("browseRepoPanel", repoPath, requestProps));
    } else {
        throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND);
    }
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:32,代码来源:SimpleRepoBrowserPage.java

示例7: throwError

import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException; //导入依赖的package包/类
/**
 * Throws an AbortWithHttpErrorCodeException with the given status and message
 *
 * @param status       Status to set for error
 * @param errorMessage Message to display in the error
 */
private void throwError(int status, String errorMessage) {
    logError(errorMessage);
    throw new AbortWithHttpErrorCodeException(status, errorMessage);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:11,代码来源:BuildBrowserRootPage.java


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