code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private static boolean applyDelete(Element delete, Document ilf) {
String nodeID = delete.getAttribute(Constants.ATT_NAME);
Element e = ilf.getElementById(nodeID);
if (e == null) return false;
String deleteAllowed = e.getAttribute(Constants.ATT_DELETE_ALLOWED);
if (deleteAllow... | java |
private static Element getDeleteSet(Document plf, IPerson person, boolean create)
throws PortalException {
Node root = plf.getDocumentElement();
Node child = root.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_DELETE_SET)) return (E... | java |
private static void addDeleteDirective(
Element compViewNode, String elementID, IPerson person, Document plf, Element delSet)
throws PortalException {
String ID = null;
try {
ID = getDLS().getNextStructDirectiveId(person);
} catch (Exception e) {
... | java |
@Override
public void perform() throws PortalException {
/*
* push the change into the PLF
*/
if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
// remove the parm edit
EditManager.removeEditDirective(nodeId, name, person);
}
/*
... | java |
@Override
public EntityIdentifier[] searchForEntities(String query, SearchMethod method)
throws GroupsException {
boolean allowPartial = true;
switch (method) {
case DISCRETE:
allowPartial = false;
break;
case STARTS_WITH:
... | java |
public void setProviders(Map<String, IPermissionTargetProvider> providers) {
this.providers.clear();
for (Map.Entry<String, IPermissionTargetProvider> provider : providers.entrySet()) {
this.providers.put(provider.getKey(), provider.getValue());
}
} | java |
@Override
public String parseString(String expressionString, PortletRequest request) {
return getValue(expressionString, request, String.class);
} | java |
protected EvaluationContext getEvaluationContext(PortletRequest request) {
Map<String, String> userInfo =
(Map<String, String>) request.getAttribute(PortletRequest.USER_INFO);
final SpELEnvironmentRoot root =
new SpELEnvironmentRoot(new PortletWebRequest(request), userInf... | java |
private Version getSimpleVersion(String product) {
final Tuple coreNumbers;
try {
final TypedQuery<Tuple> coreNumbersQuery =
this.createQuery(this.findCoreVersionNumbers);
coreNumbersQuery.setParameter(this.productParameter, product);
coreNumbers =... | java |
private String calculateDynamicSkinUrlPathToUse(PortletRequest request, String lessfileBaseName)
throws IOException {
final DynamicSkinInstanceData data = new DefaultDynamicSkinInstanceDataImpl(request);
if (!service.skinCssFileExists(data)) {
// Trigger the LESS compilation
... | java |
protected long getLastModified(Resource resource) {
try {
return resource.lastModified();
} catch (IOException e) {
this.logger.warn(
"Could not determine lastModified for "
+ resource
+ ". This resource ... | java |
@Override
public IUserInstance getUserInstance(HttpServletRequest request) throws PortalException {
try {
request = this.portalRequestUtils.getOriginalPortalRequest(request);
} catch (IllegalArgumentException iae) {
// ignore, just means that this isn't a wrapped request
... | java |
private boolean containsElmentWithId(Node node, String id) {
String nodeName = node.getNodeName();
if ("channel".equals(nodeName) || "folder".equals(nodeName)) {
Element e = (Element) node;
if (id.equals(e.getAttribute("ID"))) {
return true;
}
... | java |
public static String currentRequestContextPath() {
final RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (null == requestAttributes) {
throw new IllegalStateException(
"Request attributes are not bound. "
... | java |
protected List<? extends UserAttribute> getExpectedUserAttributes(
HttpServletRequest request, final IPortletWindow portletWindow) {
final IPortletEntity portletEntity = portletWindow.getPortletEntity();
final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
... | java |
public static IAuthorizationPrincipal principalFromUser(final IPerson user) {
Validate.notNull(user, "Cannot determine an authorization principal for null user.");
final EntityIdentifier userEntityIdentifier = user.getEntityIdentifier();
Validate.notNull(user, "The user object is defective: la... | java |
private String primGetName(String key) {
String name = key;
final IPersonAttributes personAttributes = this.paDao.getPerson(name);
if (personAttributes != null) {
Object displayName = personAttributes.getAttributeValue("displayName");
String displayNameStr = "";
... | java |
private Set<IPermission> removeInactivePermissions(final IPermission[] perms) {
Date now = new Date();
Set<IPermission> rslt = new HashSet<>(1);
for (int i = 0; i < perms.length; i++) {
IPermission p = perms[i];
if ((p.getEffective() == null || !p.getEffective().after(... | java |
static void throwIfUnrecognizedParamName(Enumeration initParamNames) throws ServletException {
final Set<String> recognizedParameterNames = new HashSet<String>();
recognizedParameterNames.add(ALLOW_MULTI_VALUED_PARAMETERS);
recognizedParameterNames.add(PARAMETERS_TO_CHECK);
recognizedPar... | java |
static Set<String> parseParametersToCheck(final String initParamValue) {
final Set<String> parameterNames = new HashSet<String>();
if (null == initParamValue) {
return parameterNames;
}
final String[] tokens = initParamValue.split("\\s+");
if (0 == tokens.length) ... | java |
static void requireNotMultiValued(final Set<String> parametersToCheck, final Map parameterMap) {
for (final String parameterName : parametersToCheck) {
if (parameterMap.containsKey(parameterName)) {
final String[] values = (String[]) parameterMap.get(parameterName);
... | java |
@Override
public synchronized void authenticate() throws PortalSecurityException {
int i;
Enumeration e = mySubContexts.elements();
while (e.hasMoreElements()) {
ISecurityContext sctx = ((Entry) e.nextElement()).getCtx();
// The principal and credential are now set f... | java |
@Override
public synchronized Enumeration getSubContexts() {
Enumeration e = mySubContexts.elements();
class Adapter implements Enumeration {
Enumeration base;
public Adapter(Enumeration e) {
this.base = e;
}
@Override
pub... | java |
@Override
public synchronized Enumeration getSubContextNames() {
Vector scNames = new Vector();
for (int i = 0; i < mySubContexts.size(); i++) {
Entry entry = (Entry) mySubContexts.get(i);
if (entry.getKey() != null) {
scNames.add(entry.getKey());
... | java |
@RenderMapping
public String initializeView(PortletRequest req, Model model) {
final IUserInstance ui =
userInstanceManager.getUserInstance(portalRequestUtils.getCurrentPortalRequest());
final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
f... | java |
protected final Date getExpiration(RenderRequest renderRequest) {
// Expiration of the JWT
final PortletSession portletSession = renderRequest.getPortletSession();
final Date rslt =
new Date(
portletSession.getLastAccessedTime()
... | java |
@Override
@RequestCache
public boolean canPrincipalManage(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
final String owner = IPermission.PORTAL_PUBLISH;
final String target = IPermission.PORTLET_PREFIX + portletDefinitionId;
... | java |
@Override
@RequestCache
public boolean canPrincipalRender(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
// This code simply assumes that anyone who can subscribe to a channel
// should be able to render it. In the future, we'd like to... | java |
@Override
@RequestCache
public boolean canPrincipalSubscribe(
IAuthorizationPrincipal principal, String portletDefinitionId) {
String owner = IPermission.PORTAL_SUBSCRIBE;
// retrieve the indicated channel from the channel registry store and
// determine its current lifecycl... | java |
@Override
public IAuthorizationPrincipal newPrincipal(String key, Class type) {
final Tuple<String, Class> principalKey = new Tuple<>(key, type);
final Element element = this.principalCache.get(principalKey);
// principalCache is self populating, it can never return a null entry
retu... | java |
private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal)
throws AuthorizationException {
if (!this.cachePermissions) {
return getUncachedPermissionsForPrincipal(principal, null, null, null);
}
IPermissionSet ps = null;
// Check the ... | java |
private String getUsernameForUserId(int id) {
if (id > 0) {
String username = userIdentityStore.getPortalUserName(id);
if (username != null) {
return username;
}
logger.warn(
"Invalid userID {} found when exporting a portlet; re... | java |
private IPortletDefinition savePortletDefinition(
IPortletDefinition definition,
List<PortletCategory> categories,
Map<ExternalPermissionDefinition, Set<IGroupMember>> permissionMap) {
boolean newChannel = (definition.getPortletDefinitionId() == null);
// save the ch... | java |
private static Calendar getCalendar(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar;
} | java |
private Set<IGroupMember> toGroupMembers(List<String> groupNames, String fname) {
final Set<IGroupMember> groups = new HashSet<>();
for (String groupName : groupNames) {
// Assumes the groupName case matches the DB values.
EntityIdentifier[] gs =
GroupService.... | java |
private ExternalPermissionDefinition toExternalPermissionDefinition(
String system, String activity) {
ExternalPermissionDefinition def = ExternalPermissionDefinition.find(system, activity);
if (def != null) {
return def;
}
String delim = "";
StringBuilde... | java |
public static void setCachingHeaders(
int maxAge,
boolean publicScope,
long lastModified,
PortletResourceOutputHandler portletResourceOutputHandler) {
if (maxAge != 0) {
portletResourceOutputHandler.setDateHeader("Last-Modified", lastModified);
... | java |
@Override
public void perform() throws PortalException {
Element plfNode = HandlerUtils.getPLFNode(ilfNode, person, false, false);
if (plfNode == null) return;
changeRestriction(Constants.ATT_MOVE_ALLOWED, plfNode, moveAllowed);
changeRestriction(Constants.ATT_MOVE_ALLOWED, ilfNode... | java |
private String getProxyTicket(PortletRequest request) {
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
// try to determine the URL for our portlet
String targetService = null;
try {
URL url = null;
... | java |
@SuppressWarnings("unchecked")
private static ISecurityContext getCasContext(ISecurityContext context) {
if (context instanceof ICasSecurityContext) {
return context;
}
Enumeration contextEnum = context.getSubContexts();
while (contextEnum.hasMoreElements()) {
... | java |
protected List<AcademicTermDetail> getAcademicTermsAfter(DateTime start) {
final List<AcademicTermDetail> terms =
this.eventAggregationManagementDao.getAcademicTermDetails();
final int index =
Collections.binarySearch(
terms,
... | java |
protected File getFileRoot(Class type) {
String path = getGroupsRootPath() + type.getName();
File f = new File(path);
return (f.exists()) ? f : null;
} | java |
private void primGetAllDirectoriesBelow(File dir, Set allDirectories) {
File[] files = dir.listFiles(fileFilter);
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
primGetAllDirectoriesBelow(files[i], allDirectories);
allDirectories.add(fi... | java |
@RequestMapping(value = "/deletePermission", method = RequestMethod.POST)
public void deletePermission(
@RequestParam("principal") String principal,
@RequestParam("owner") String owner,
@RequestParam("activity") String activity,
@RequestParam("target") String target,
... | java |
protected void cancelWorker(
HttpServletRequest request, IPortletExecutionWorker<?> portletExecutionWorker) {
final IPortletWindowId portletWindowId = portletExecutionWorker.getPortletWindowId();
final IPortletWindow portletWindow =
this.portletWindowRegistry.getPortletWindow... | java |
@Override
public void startPortletHeaderRender(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
if (doesPortletNeedHeaderWorker(portletWindowId, request)) {
this.startPortletHeaderRenderInternal(portletWindowId, re... | java |
protected PortletRenderResult getPortletRenderResult(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
final IPortletRenderExecutionWorker tracker =
getRenderedPortletBodyWorker(portletW... | java |
protected IPortletRenderExecutionWorker startPortletHeaderRenderInternal(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
IPortletRenderExecutionWorker portletHeaderRenderWorker =
this.portletWorkerFactory.createRe... | java |
protected IPortletRenderExecutionWorker startPortletRenderInternal(
IPortletWindowId portletWindowId,
HttpServletRequest request,
HttpServletResponse response) {
// first check to see if there is a Throwable in the session for this IPortletWindowId
final Map<IPortletW... | java |
private boolean add(T e, boolean failWhenFull) {
final Queue<T> queue = this.getOrCreateQueue(e);
this.writeLock.lock();
try {
if (this.size == this.capacity) {
if (failWhenFull) {
throw new IllegalStateException("Queue is at capacity: " + this.ca... | java |
protected void deletePortletEntity(
HttpServletRequest request, IPortletEntity portletEntity, boolean cacheOnly) {
final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
// Remove from request cache
final PortletEntityCache<IPortletEntity> portletEntityMap =
... | java |
protected IPortletEntity getPortletEntity(
HttpServletRequest request,
PortletEntityCache<IPortletEntity> portletEntityCache,
IPortletEntityId portletEntityId,
String layoutNodeId,
int userId) {
IPortletEntity portletEntity;
// First look in ... | java |
private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_EDIT_SET)) return (Element) child;
child = c... | java |
static void addEditDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_EDIT, person);
} | java |
public static void addPrefsDirective(Element plfNode, String attributeName, IPerson person)
throws PortalException {
addDirective(plfNode, attributeName, Constants.ELM_PREF, person);
} | java |
private static void addDirective(
Element plfNode, String attributeName, String type, IPerson person)
throws PortalException {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element editSet = getEditSet(plfNode, plf, person, true);
// see if attributes has... | java |
public static boolean applyEditSet(Element plfChild, Element original) {
// first get edit set if it exists
Element editSet = null;
try {
editSet = getEditSet(plfChild, null, null, false);
} catch (Exception e) {
// should never occur unless problem during create ... | java |
private static void removeDirective(
String elementId, String attributeName, String type, IPerson person) {
Document plf = (Document) person.getAttribute(Constants.PLF);
Element node = plf.getElementById(elementId);
if (node == null) return;
Element editSet = null;
... | java |
protected void removeExpiredPortletCookies(HttpServletRequest request) {
Map<String, SessionOnlyPortletCookieImpl> sessionOnlyCookies =
getSessionOnlyPortletCookieMap(request);
for (Entry<String, SessionOnlyPortletCookieImpl> entry : sessionOnlyCookies.entrySet()) {
String ke... | java |
@Override
public InputSource resolveEntity(String publicId, String systemId) {
InputStream inStream = null;
// Check for a match on the systemId
if (systemId != null) {
if (dtdName != null && systemId.indexOf(dtdName) != -1) {
inStream = getResourceAsStream(dtdPa... | java |
protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final... | java |
private synchronized void initialize() {
Iterator types = EntityTypesLocator.getEntityTypes().getAllEntityTypes();
String factoryName = null;
while (types.hasNext()) {
Class type = (Class) types.next();
if (type != Object.class) {
String factoryKey =
... | java |
protected void synchronizeGroupMembersOnDelete(IEntityGroup group) throws GroupsException {
GroupMemberImpl gmi = null;
for (Iterator it = group.getChildren().iterator(); it.hasNext(); ) {
gmi = (GroupMemberImpl) it.next();
gmi.invalidateInParentGroupsCache(Collections.singleton... | java |
protected void synchronizeGroupMembersOnUpdate(IEntityGroup group) throws GroupsException {
EntityGroupImpl egi = (EntityGroupImpl) group;
GroupMemberImpl gmi = null;
for (Iterator it = egi.getAddedMembers().values().iterator(); it.hasNext(); ) {
gmi = (GroupMemberImpl) it.next();
... | java |
public Object doThreadContextClassLoaderUpdate(ProceedingJoinPoint pjp) throws Throwable {
final Thread currentThread = Thread.currentThread();
final ClassLoader previousClassLoader = currentThread.getContextClassLoader();
Deque<ClassLoader> deque = PREVIOUS_CLASS_LOADER.get();
if (deque... | java |
@RequestMapping(value = "/entity/{entityType}/{entityId}", method = RequestMethod.DELETE)
public void deleteEntity(
@PathVariable("entityType") String entityType,
@PathVariable("entityId") String entityId,
HttpServletRequest request,
HttpServletResponse response)
... | java |
@Override
public double getStandardDeviation() {
double stdDev = Double.NaN;
if (getN() > 0) {
if (getN() > 1) {
stdDev = FastMath.sqrt(getVariance());
} else {
stdDev = 0.0;
}
}
return stdDev;
} | java |
public void sendBatch() {
LrsStatement statement = null;
List<LrsStatement> list = new ArrayList<LrsStatement>();
while ((statement = statementQueue.poll()) != null) {
list.add(statement);
}
if (!list.isEmpty()) {
postStatementList(list);
}
} | java |
private void postStatementList(List<LrsStatement> list) {
try {
ResponseEntity<Object> response =
sendRequest(
STATEMENTS_REST_ENDPOINT, HttpMethod.POST, null, list, Object.class);
if (response.getStatusCode().series() == Series.SUCCESSFUL)... | java |
public final void addValue(double v) {
if (isComplete()) {
this.getLogger()
.warn(
"{} is already closed, the new value of {} will be ignored on: {}",
this.getClass().getSimpleName(),
v,
... | java |
@RequestMapping(value = "/portletList", method = RequestMethod.GET)
public ModelAndView listChannels(
WebRequest webRequest,
HttpServletRequest request,
@RequestParam(value = "type", required = false) String type) {
if (TYPE_MANAGE.equals(type)) {
throw new U... | java |
@Override
public LrsStatement toLrsStatement(PortalEvent event) {
return new LrsStatement(getActor(event), getVerb(event), getLrsObject(event));
} | java |
protected LrsActor getActor(PortalEvent event) {
String username = event.getUserName();
return actorService.getLrsActor(username);
} | java |
protected URI buildUrn(String... parts) {
UrnBuilder builder = new UrnBuilder("UTF-8", "tincan", "uportal", "activities");
builder.add(parts);
return builder.getUri();
} | java |
@Bean(name = "usernameAttributeProvider")
public IUsernameAttributeProvider getUsernameAttributeProvider() {
final SimpleUsernameAttributeProvider rslt = new SimpleUsernameAttributeProvider();
rslt.setUsernameAttribute(USERNAME_ATTRIBUTE);
return rslt;
} | java |
@Bean(name = "requestAttributeSourceFilter")
public Filter getRequestAttributeSourceFilter() {
final RequestAttributeSourceFilter rslt = new RequestAttributeSourceFilter();
rslt.setAdditionalDescriptors(getRequestAdditionalDescriptors());
rslt.setUsernameAttribute(REMOTE_USER_ATTRIBUTE); // ... | java |
@Bean(name = "sessionAttributesOverridesMap")
@Scope(value = "globalSession", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Map getSessionAttributesOverridesMap() {
return new ConcurrentHashMap();
} | java |
@Bean(name = "personAttributeDao")
@Qualifier("personAttributeDao")
public IPersonAttributeDao getPersonAttributeDao() {
final PortalRootPersonAttributeDao rslt = new PortalRootPersonAttributeDao();
rslt.setDelegatePersonAttributeDao(getRequestAttributeMergingDao());
rslt.setAttributeOve... | java |
@Bean(name = "requestAttributeMergingDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributeMergingDao() {
final MergingPersonAttributeDaoImpl rslt = new MergingPersonAttributeDaoImpl();
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.se... | java |
@Bean(name = "requestAttributesDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getRequestAttributesDao() {
final AdditionalDescriptorsPersonAttributeDao rslt =
new AdditionalDescriptorsPersonAttributeDao();
rslt.setDescriptors(getRequestAdditionalDescriptors());
... | java |
@Bean(name = "cachingPersonAttributeDao")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getCachingPersonAttributeDao() {
final CachingPersonAttributeDaoImpl rslt = new CachingPersonAttributeDaoImpl();
rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());
rslt.setC... | java |
@Bean(name = "innerMergedPersonAttributeDaoList")
public List<IPersonAttributeDao> getInnerMergedPersonAttributeDaoList() {
final List<IPersonAttributeDao> rslt = new ArrayList<>();
rslt.add(getImpersonationStatusPersonAttributeDao());
rslt.add(getUPortalAccountUserSource());
rslt.ad... | java |
@Bean(name = "uPortalAccountUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalAccountUserSource() {
final LocalAccountPersonAttributeDao rslt = new LocalAccountPersonAttributeDao();
rslt.setLocalAccountDao(localAccountDao);
rslt.setUsernameAttributeProvider(... | java |
@Bean(name = "uPortalJdbcUserSource")
@Qualifier("uPortalInternal")
public IPersonAttributeDao getUPortalJdbcUserSource() {
final String sql = "SELECT USER_NAME FROM UP_USER WHERE {0}";
final SingleRowJdbcPersonAttributeDao rslt =
new SingleRowJdbcPersonAttributeDao(personDb, sql... | java |
static void addParameterChild(Element node, String name, String value) {
if (node != null) {
Document doc = node.getOwnerDocument();
Element parm = doc.createElement(Constants.ELM_PARAMETER);
parm.setAttribute(Constants.ATT_NAME, name);
parm.setAttribute(Constants... | java |
protected final <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
return this.getEntityManager().createQuery(criteriaQuery);
} | java |
protected final <T> TypedQuery<T> createCachedQuery(CriteriaQuery<T> criteriaQuery) {
final TypedQuery<T> query = this.getEntityManager().createQuery(criteriaQuery);
final String cacheRegion = getCacheRegionName(criteriaQuery);
query.setHint("org.hibernate.cacheable", true);
query.setHin... | java |
protected final <T> String getCacheRegionName(CriteriaQuery<T> criteriaQuery) {
final Set<Root<?>> roots = criteriaQuery.getRoots();
final Class<?> cacheRegionType = roots.iterator().next().getJavaType();
final String cacheRegion = cacheRegionType.getName() + QUERY_SUFFIX;
if (roots.siz... | java |
protected Map session(){
Map session;
try{
SimpleHash sessionHash = (SimpleHash)get("session");
session = sessionHash.toMap();
}catch(Exception e){
logger().warn("failed to get a session map in context, returning session without data!!!", e);
sess... | java |
protected RenderBuilder render(){
String template = Router.getControllerPath(getClass()) + "/" + RequestContext.getRoute().getActionName();
return super.render(template, values());
} | java |
public boolean actionSupportsHttpMethod(String actionMethodName, HttpMethod httpMethod) {
if (restful()) {
return restfulActionSupportsHttpMethod(actionMethodName, httpMethod) || standardActionSupportsHttpMethod(actionMethodName, httpMethod);
} else {
return standardActionSupport... | java |
protected Route recognize(String uri, HttpMethod httpMethod) throws ClassLoadException {
if (uri.endsWith("/") && uri.length() > 1) {
uri = uri.substring(0, uri.length() - 1);
}
ControllerPath controllerPath = getControllerPath(uri);
Route route = matchCustom(uri, controll... | java |
private Route matchStandard(String uri, ControllerPath controllerPathObject, AppController controller, HttpMethod method) {
String controllerPath = (controllerPathObject.getControllerPackage() != null ? "/" + controllerPathObject.getControllerPackage().replace(".", "/") : "") + "/" + controllerPathObject.getCo... | java |
protected static String findControllerNamePart(String pack, String uri) {
String temp = uri.startsWith("/") ? uri.substring(1) : uri;
temp = temp.replace("/", ".");
if (temp.length() > pack.length())
temp = temp.substring(pack.length() + 1);
if (temp.equals("") )
... | java |
protected String findPackageSuffix(String uri) {
String temp = uri.startsWith("/") ? uri.substring(1) : uri;
temp = temp.replace(".", "_");
temp = temp.replace("/", ".");
//find all matches
List<String> candidates = new ArrayList<>();
for (String pack : Configuration.g... | java |
public <T extends AppController> RouteBuilder to(Class<T> type) {
boolean hasControllerSegment = false;
for (Segment segment : segments) {
hasControllerSegment = segment.controller;
}
if (type != null && hasControllerSegment) {
throw new IllegalArgumentExceptio... | java |
public RouteBuilder action(String action) {
boolean hasActionSegment = false;
for (Segment segment : segments) {
hasActionSegment = segment.action;
}
if(action!= null && hasActionSegment){
throw new IllegalArgumentException("Cannot combine {action} segment and .a... | java |
public RouteBuilder get(){
if(!methods.contains(HttpMethod.GET)){
methods.add(HttpMethod.GET);
}
return this;
} | java |
public RouteBuilder post(){
if(!methods.contains(HttpMethod.POST)){
methods.add(HttpMethod.POST);
}
return this;
} | java |
public RouteBuilder options(){
if(!methods.contains(HttpMethod.OPTIONS)){
methods.add(HttpMethod.OPTIONS);
}
return this;
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.