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
# Directories # | |
/build/ | |
/bin/ | |
target/ | |
# OS Files # | |
.DS_Store | |
*.class | |
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
@Override | |
public int hashCode() { | |
${hashBuilderType:newType(org.apache.commons.lang.builder.HashCodeBuilder)} builder = new ${hashBuilderType}(); | |
builder.append(${field});${cursor} | |
return ${builder}.toHashCode(); | |
} | |
@Override | |
public boolean equals(Object obj) { | |
if (this == obj) { |
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
package com.bmchild.utils; | |
import java.util.Objects; | |
import java.util.function.Predicate; | |
/** | |
* Non functional way of chaining predicates together | |
* @author brettchild | |
* | |
* @param <T> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" | |
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd | |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd | |
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd |
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
package com.bmchild.security.access.expression; | |
import org.aopalliance.intercept.MethodInvocation; | |
import org.apache.log4j.Logger; | |
import org.springframework.security.access.expression.SecurityExpressionRoot; | |
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; | |
import org.springframework.security.core.Authentication; | |
/** | |
* @author bchild |
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
/** | |
* | |
*/ | |
package com.mypackage.utilities; | |
import java.lang.reflect.Method; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.lang.builder.EqualsBuilder; |
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
/** | |
* | |
*/ | |
package com.bmchild.validation.constraints; | |
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | |
import static java.lang.annotation.ElementType.CONSTRUCTOR; | |
import static java.lang.annotation.ElementType.FIELD; | |
import static java.lang.annotation.ElementType.METHOD; | |
import static java.lang.annotation.ElementType.PARAMETER; |
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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<root> | |
<data> | |
<discharge_status>ACTIVE</discharge_status> | |
<suspension_rec> | |
<start>0815</start> | |
<end>0115</end> | |
</suspension_rec> | |
<suspension_rec> |
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
package com.bmchild.stack.commons.utilities.security; | |
import java.io.IOException; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.apache.commons.codec.binary.Base64; | |
import org.apache.commons.httpclient.HttpClient; | |
import org.apache.commons.httpclient.HttpStatus; | |
import org.apache.commons.httpclient.NameValuePair; |
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
@RequestMapping(value = "/runJobAndGetLogs", method = RequestMethod.GET) | |
public ResponseEntity<StreamingResponseBody> runJobAndGetLogs() throws IOException { | |
final InputStream inputStream = someService.runJobAndGetReportProgress(); | |
StreamingResponseBody body = StreamingResponseBody body = (outputStream) -> { | |
try (BufferedInputStream br = new BufferedInputStream(inputStream)) { | |
// just copying to the outputstream | |
byte[] contents = new byte[1024]; | |
int bytesRead = 0; | |
while ((bytesRead = br.read(contents)) != -1) { |
NewerOlder