Skip to content
Common Alerting Protocol Library
HTML Java Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
java Fix langauge bug. Sep 23, 2019
proto
schema
testdata
validator
.gitignore Export Google-internal library externally, fix tests Oct 26, 2014
.travis.yml Update AE version Mar 15, 2015
LICENSE Rename LICENSE.md to LICENSE to keep it plaintext Oct 3, 2014
README.md Fix typo in README.md Oct 22, 2014
build.xml Reorganize java code and resources under the java/ tree. Mar 19, 2011

README.md

Common Alerting Protocol Library Build Status

Copyright 2014 Google Inc.

http://github.com/google/cap-library/

===========

The CAP Library is a collection of code and tools to work with public alerting messages in the [Common Alerting Protocol] (http://en.wikipedia.org/wiki/Common_Alerting_Protocol) format.

Namely, a well-tested and easy-to-use Java library that supports

  • creation and parsing of feeds in the CAP format,
  • validating of feeds against common CAP profiles.

Moreover, it includes a simple [web application] (http://cap-validator.appspot.com/) to validate the correctness of CAP messages.

About

The CAP Library is designed to support CAP versions 1.0, 1.1, and 1.2. There are classes that can parse XML CAP messages as well as easily create new messages and write them to XML, JSON, (soon) ASN.1, and (soon) KML.

The main data structures are auto-generated from a Google protocol buffer implementation of the CAP spec in proto/cap.proto. Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data - think XML, but smaller, faster, and simpler.

The generated classes offer a clean API for creating and manipulating alert objects. The alert data structures are immutable; they provide only getters. New alerts are constructed via Builder classes. See javatests/com/google/publicalerts/cap/TestUtil.java, for an example.

javatests/com/google/publicalerts/cap/EndToEndTest.java provides a good overview of how to get started using the library.

To learn more about Google protocol buffers, see http://code.google.com/apis/protocolbuffers/ and http://code.google.com/apis/protocolbuffers/docs/reference/java-generated.html

Development

###Install ant You can download and install Apache Ant from http://ant.apache.org/.

###Run all tests

» APPENGINE_JAVA_SDK=/path/to/appengine-sdk ant test

###Compile the library into a jar

» cd java
» ant jar

###Compile and run the validator

» cd validator
» APPENGINE_JAVA_SDK=/path/to/appengine-sdk ant runserver
You can’t perform that action at this time.