Search in sources :

Example 6 with PathMapping

use of org.codelibs.fess.es.config.exentity.PathMapping in project fess by codelibs.

the class PathMappingHelperTest method test_replaceUrl.

public void test_replaceUrl() {
    final String sessionId = "test";
    final List<PathMapping> pathMappingList = new ArrayList<PathMapping>();
    final PathMapping pathMapping = new PathMapping();
    pathMapping.setRegex("file:///home/");
    pathMapping.setReplacement("http://localhost/");
    pathMappingList.add(pathMapping);
    pathMappingHelper.setPathMappingList(sessionId, pathMappingList);
    final String url = "file:///home/user/";
    assertEquals("http://localhost/user/", pathMappingHelper.replaceUrl(sessionId, url));
}
Also used : PathMapping(org.codelibs.fess.es.config.exentity.PathMapping) ArrayList(java.util.ArrayList)

Aggregations

PathMapping (org.codelibs.fess.es.config.exentity.PathMapping)6 PathMapPager (org.codelibs.fess.app.pager.PathMapPager)4 AdminPathmapAction.getPathMapping (org.codelibs.fess.app.web.admin.pathmap.AdminPathmapAction.getPathMapping)4 ApiResult (org.codelibs.fess.app.web.api.ApiResult)4 Execute (org.lastaflute.web.Execute)4 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 Resource (javax.annotation.Resource)3 Constants (org.codelibs.fess.Constants)3 PathMappingService (org.codelibs.fess.app.service.PathMappingService)3 CrudMode (org.codelibs.fess.app.web.CrudMode)3 FessApiAdminAction (org.codelibs.fess.app.web.api.admin.FessApiAdminAction)3 JsonResponse (org.lastaflute.web.response.JsonResponse)3 ArrayList (java.util.ArrayList)2