Skip to content

Provides small self-contained examples of how to do interesting things

Notifications You must be signed in to change notification settings

romeara/code-examples

Repository files navigation

Code Examples

Provides some small apps and code examples for interesting operations

Apps

JCenter Versions

Demonstrates how to communicate with JCenter REST APIs to get version info for an artifact

Additional Examples in this App

  • Adding HTTP Basic Communication to a URLConnection or extension thereof
  • Use the JSON-Simple library for basic JSON return parsing

Spring Boot GitHub SSO

Demonstrates how to use spring security to implement "Login with GitHub"

Regex Capture Groups

Demonstrates how to selectively capture content via regex pattern

Additional Examples in this App

  • Reading file content from the classpath of the project in a way which continues to work after being packaged into a jar archive

Query Construction

Demonstrates syntax for a PostgreSQL values statement

Additional Examples in this App

  • Gradle support of code coverage (JaCoCo)
  • Gradle support of code quality tools (sonarqube)
  • Gradle custom source sets
  • Adding compile/runtime dependencies for a source set
  • Gradle configuration of Eclipse project values
  • Gradle listing dependency trees
  • Sonar 4.5.6 support for Java 8 (comment in build file)

Jetty Access

Demonstrates filtering access to a Jetty server based on IP address

Additional Examples in this App

  • Simple embedded Jetty server setup and use
  • Lookup of a random open port on the local machine
  • Use of Jetty handlers
  • Redirecting requests based on IP filtering to a specified location

Restlet

Demonstrates a simple Restlet application

Additional Examples in this App

  • Setup of a simple Restlet application with an end point
  • Setup of dependency injection support for end point implementations using spring autowiring

Mail

Demonstrates use of the Java Mail APIs

Additional Examples in this App

  • Basic sending of mail from one address to another use the Java Mail APIs
  • Specifying the format of the e-mail as HTML
  • Use of args4j to get the relay location
  • Use of callback handler to get the email to send from and to at runtime

About

Provides small self-contained examples of how to do interesting things

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published