-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Servlet API related Share fixes - Mail/Subetha related Repository fixes - cross-compilation where necessary
- Loading branch information
Showing
49 changed files
with
2,656 additions
and
185 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
core/common/src/main/java/de/acosix/alfresco/utility/common/function/Callback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2016 - 2024 Acosix GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.acosix.alfresco.utility.common.function; | ||
|
||
/** | ||
* Instances of this interface represent simple no parameter / no return value callbacks. | ||
* | ||
* @author Axel Faust | ||
*/ | ||
@FunctionalInterface | ||
public interface Callback<T extends Throwable> | ||
{ | ||
|
||
/** | ||
* Execute the callback. | ||
*/ | ||
void execute() throws T; | ||
} |
75 changes: 75 additions & 0 deletions
75
...mmon/src/main/java/de/acosix/alfresco/utility/common/servlet/ServletHelperOperations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright 2016 - 2024 Acosix GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.acosix.alfresco.utility.common.servlet; | ||
|
||
import java.util.Enumeration; | ||
|
||
/** | ||
* | ||
* @author Axel Faust | ||
*/ | ||
public interface ServletHelperOperations | ||
{ | ||
|
||
/** | ||
* Returns the login of the user making this request, if the user has been authenticated, or <code>null</code> if the user has not | ||
* been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. | ||
* Same as the value of the CGI variable REMOTE_USER. | ||
* | ||
* @return a string specifying the login of the user making this request, or {@code null} if the user login is not known | ||
*/ | ||
String getRemoteUser(); | ||
|
||
/** | ||
* Returns the value of the specified request header as a string. If the request did not include a header of the specified name, | ||
* this method returns <code>null</code>. If there are multiple headers with the same name, this method returns the first head in | ||
* the request. The header name is case insensitive. You can use this method with any request header. | ||
* | ||
* @param name | ||
* a string specifying the header name | ||
* @return a string containing the value of the requested header, or {@code null} if the current request does not have a header of | ||
* that name | ||
*/ | ||
String getRequestHeader(String name); | ||
|
||
/** | ||
* Returns all values of the specified request header as a strings. If the request did not include a header of the specified name, | ||
* this method returns <code>null</code>. If there are multiple headers with the same name, this method returns the first head in | ||
* the request. The header name is case insensitive. You can use this method with any request header. | ||
* | ||
* @param name | ||
* a string specifying the header name | ||
* @return an enumeration of strings containing the values of the requested header, or {@code null} if the current request does not | ||
* have a header of that name | ||
*/ | ||
Enumeration<String> getRequestHeaders(String name); | ||
|
||
/** | ||
* Returns all the header names set in the current request. | ||
* | ||
* @return an enumeration of all the header names sent with the current request | ||
*/ | ||
Enumeration<String> getRequestHeaderNames(); | ||
|
||
/** | ||
* Returns the value of an attribute with the specified name in an active session | ||
* | ||
* @param name | ||
* a string specifying the name of the attribute | ||
* @return the value of the requested attribute, or {@code null} if the active session does not have an attribute of that name | ||
*/ | ||
Object getSessionAttribute(String name); | ||
} |
71 changes: 71 additions & 0 deletions
71
...c/main/java/de/acosix/alfresco/utility/common/spring/condition/ClassDefinedCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright 2016 - 2024 Acosix GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.acosix.alfresco.utility.common.spring.condition; | ||
|
||
import org.springframework.beans.factory.BeanFactory; | ||
import org.springframework.beans.factory.support.BeanDefinitionRegistry; | ||
|
||
/** | ||
* | ||
* @author Axel Faust | ||
*/ | ||
public class ClassDefinedCondition extends BaseBeanDefinitionPostProcessorCondition | ||
{ | ||
|
||
private String className; | ||
|
||
/** | ||
* @param className | ||
* the name of the class to check if it is defined | ||
*/ | ||
public void setClassName(final String className) | ||
{ | ||
this.className = className; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean applies(final BeanFactory factory) | ||
{ | ||
return this.applies(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean applies(final BeanDefinitionRegistry registry) | ||
{ | ||
return this.applies(); | ||
} | ||
|
||
protected boolean applies() | ||
{ | ||
boolean applies = false; | ||
try | ||
{ | ||
Class.forName(this.className); | ||
applies = !this.negate; | ||
} | ||
catch (final ClassNotFoundException e) | ||
{ | ||
applies = this.negate; | ||
} | ||
return applies; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.