Buying Options
Jakarta Commons Cookbook
Print $44.95
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £34.50
Add to Cart
What is this?
Description
This collection provides expert tips for using the utilities of the Java-based Jakarta Commons open source project. You don't have to be an expert, the book's solution-based format contains code examples for a wide variety of web, XML, network, testing, and application projects. If you want to learn how to use Jakarta Commons utilities to create powerful Java applications and tools, the Jakarta Commons Cookbook is for you.
Full Description
Table of Contents
  1. Chapter 1 Supplements to the Java 2 Platform

    1. Introduction

    2. Obtaining Commons Lang

    3. Joining the Commons-User Mailing List

    4. Getting the Commons Lang Source Code

    5. Automating the Generation of toString( ) Content

    6. Customizing Generated toString( ) Content

    7. Automating hashCode( ) and equals( )

    8. Automating compareTo( )

    9. Printing an Array

    10. Cloning and Reversing Arrays

    11. Transforming Between Object Arraysand Primitive Arrays

    12. Finding Items in an Array

    13. Creating a Map from a Multidimensional Array

    14. Formatting Dates

    15. Rounding Date Objects

    16. Truncating Date Objects

    17. Creating an Enum

    18. Generating Unique Numeric Identifiers

    19. Validation of Method Parameters

    20. Measuring Time

  2. Chapter 2 Manipulating Text

    1. Introduction

    2. Setting Up StringUtils and WordUtils

    3. Checking for an Empty String

    4. Abbreviating Strings

    5. Splitting a String

    6. Finding Nested Strings

    7. Stripping and Trimming a String

    8. Chomping a String

    9. Creating an Emphasized Header

    10. Reversing a String

    11. Wrapping Words

    12. Testing the Contents of a String

    13. Measuring the Frequency of a String

    14. Parsing Formatted Strings

    15. Calculating String Difference

    16. Using Commons Codec

    17. Getting the Commons Codec Source Code

    18. Calculating Soundex

  3. Chapter 3 JavaBeans

    1. Introduction

    2. Representing Beans Graphically

    3. Obtaining Commons BeanUtils

    4. Getting the Commons BeanUtils Source Code

    5. Accessing Simple Bean Properties

    6. Accessing Nested Bean Properties

    7. Accessing Indexed Bean Properties

    8. Accessing Mapped Bean Properties

    9. Accessing a Simple, Nested, Indexed, and Mapped Bean Property

    10. Determining the Type of a Bean Property

    11. Comparing Beans

    12. Copying Bean Properties

    13. Cloning a Bean

    14. Setting a Bean Property

    15. Testing Property Access

    16. Validating Beans with Predicates

    17. Creating a Map of Bean Properties

    18. Wrapping a Bean with a Map

    19. Creating a Dynamic Bean

    20. Getting and Setting Properties as Strings

  4. Chapter 4 Functors

    1. Introduction

    2. Obtaining Commons Collections

    3. Getting the Commons Collections Source Code

    4. Reversing a Comparator

    5. Chaining Comparators

    6. Comparing Nulls

    7. Fixed-Order Comparison

    8. Using Simple Predicates

    9. Writing a Custom Predicate

    10. Creating Composite Predicates

    11. Transforming Objects

    12. Creating a Chain of Transformations

    13. Applying Conditional Transformations

    14. Writing a Closure

    15. Chaining Closures

    16. Modeling Conditional Statements with Closures

    17. Modeling Loops with Closures

  5. Chapter 5 Collections

    1. Introduction

    2. Obtaining Commons Collections

    3. Using a Looping Iterator

    4. Iterating Over an ArrayList

    5. Filtering a Collection with a Predicate

    6. Iterating Through Distinct Elements

    7. Using a Bag

    8. Using a Buffer

    9. Creating a Priority Queue

    10. Using a Blocking Buffer

    11. Storing Multiple Values in a Map

    12. Retrieving a Key by a Value

    13. Using a Case-Insensitive Map

    14. Creating Typed Collections and Maps

    15. Constraining Map Values

    16. Constraining List Contents

    17. Transforming Collections

    18. Creating a Least Recently Used Cache

    19. Using a Lazy Map

    20. Counting Objects in a Collection

    21. Performing Set Operations

    22. Retrieving Map Values Without Casting

  6. Chapter 6 XML

    1. Introduction

    2. Obtaining Jakarta Commons Digester

    3. Turning XML Documents into Objects

    4. Namespace-Aware Parsing

    5. Creating a Simple XML Command Language

    6. Variable Substitution and XML Parsing

    7. Obtaining Jakarta Commons Betwixt

    8. Turning Beans into XML Documents

    9. Customizing XML Generated from an Object

    10. Turning XML Documents into Beans

  7. Chapter 7 Application Infrastructure

    1. Introduction

    2. Obtaining Commons CLI

    3. Parsing a Simple Command Line

    4. Parsing a Complex Command Line

    5. Printing Usage Information

    6. Obtaining Commons Configuration

    7. Configuring Applications with Properties Files

    8. Configuring Applications with XML

    9. Using Composite Configuration

    10. Obtaining Commons Logging

    11. Using an Abstract Logging Interface

    12. Specifying a Logging Implementation

    13. Obtaining Apache Log4J

    14. Configuring Log4J with a Properties File

    15. Configuring Log4J with XML

  8. Chapter 8 Math

    1. Introduction

    2. Using Fractions

    3. Finding the Maximum and Minimum in an Array

    4. Using Number Ranges

    5. Generating Random Variables

    6. Obtaining Commons Math

    7. Calculating Simple Univariate Statistics

    8. Solving a System of Linear Equations

    9. Arithmetic with Complex Numbers

    10. Establishing Relationships Between Variables

    11. Estimating the Amount of Time Left in a Process

  9. Chapter 9 Templating

    1. Introduction

    2. Obtaining Commons JEXL

    3. Using an Expression Language

    4. Invoking Methods in an Expression

    5. Externalizing Logic with an Expression Language

    6. Obtaining Jakarta Velocity

    7. Using a Simple Templating Language

    8. Writing Templates with Conditionals and Loops

    9. Using Macros in a Templating Engine

    10. Invoking Methods in a Template

    11. Obtaining FreeMarker

    12. Using a Complex Scripting Engine

    13. Accessing XML Documents from a Templating Engine

    14. Using Velocity in a Web Application

    15. Using FreeMarker in a Web Application

    16. Writing Templates in Eclipse

  10. Chapter 10 I/O and Networking

    1. Introduction

    2. Obtaining Commons IO

    3. Copying Streams, byte[ ], Readers, and Writers

    4. Closing Streams, Readers, and Writers

    5. Printing a Human-Readable File Size

    6. Copying Files, Strings, and URLs

    7. Deleting Directories Recursively

    8. Obtaining the Size of a Directory

    9. Touching a File

    10. Filtering Files

    11. Measuring Stream Traffic

    12. Splitting an OutputStream

    13. Obtaining Jakarta ORO

    14. Using Globs and Perl5 Regular Expressions to List Files

    15. Obtaining Commons Net

    16. Writing an FTP Client

    17. Sending Mail with SMTP

    18. Checking a POP3 Mailbox

  11. Chapter 11 HTTP and WebDAV

    1. Introduction

    2. Obtaining Jakarta HttpClient

    3. Getting Jakarta HttpClient Source Code

    4. Performing an HTTP GET

    5. Sending Parameters in a Query String

    6. Retrieving Content with a Conditional GET

    7. Debugging HTTP Communications

    8. Making an HTTP POST Request

    9. Sending POST Data from a File

    10. Uploading Files with a Multipart POST

    11. Basic Authentication

    12. NTLM Authentication

    13. Working with Cookies

    14. Handling Redirects

    15. SSL

    16. Accepting a Self-Signed Certificate

    17. Obtaining Jakarta Slide

    18. Connecting to WebDAV Resources

    19. Modifying a WebDAV Resource

  12. Chapter 12 Searching and Filtering

    1. Introduction

    2. Obtaining Commons JXPath

    3. Querying an Object Graph with XPath

    4. Search a Collection of Simple Objects

    5. Applying XPath Queries to Complex Object Graphs

    6. Obtaining Jakarta Lucene

    7. Creating an Index of XML Documents

    8. Searching for a Specific Term in a Document Index

    9. Finding the Frequency of Terms in an Index

  1. Colophon

View Full Table of Contents
Product Details
Title:
Jakarta Commons Cookbook
By:
Timothy M. O'Brien
Publisher:
O'Reilly Media
Formats:
  • Print
  • Safari Books Online
Print Release:
November 2004
Pages:
400
Print ISBN:
978-0-596-00706-5
| ISBN 10:
0-596-00706-X
Customer Reviews
About the Author
  1. Timothy M. O'Brien

    Tim O'Brien is an active committer in the Jakarta Commons, a sub-project of the Apache Software Foundation's Jakarta project. As a consultant, Tim tries to encourage the adoption of open-source software, and nudge organizations to view community participation as an essential strategy. In addition to his professional responsibilities, he is a Bass/Baritone who sings frequently in the Chicagoland area. Tim discovered programming on a Basic Four, TRS-80, and Commodore 64 in his hometown of Wellesley, Massachusetts; subsequently, studying Computer Engineering at the University of Virginia

    View Timothy M. O'Brien's full profile page.

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Jakarta Commons Cookbook is an aardvark. Native to the grasslands and woodlands of sub-Saharan Africa, the aardvark is the only surviving species in the Orycteropodidae family of mammals. Despite being named for its resemblance to the pig (the word aardvark derives from the Dutch for "earth pig"), the aardvark's appearance is far more similar to that of marsupials, such as the bilby and the bandicoot.

Aardvarks are distinguished by their pig-like torso, arched back, oversized ears, and lengthy snout. They are typically yellow-gray in color, although their tough skin may appear reddish-brown when coated in soil. On average, the adult aadvark is slightly more than three feet long and weighs approximately 90 to 140 pounds. Aardvarks dine almost exclusively on ants and termites, for which their tiny, tubular mouth and long, slender tongue are ideally suited. Upon locating a cache of ants with their keen sense of smell, aardvarks use their strong front legs to dig into the nest and rapidly lap up the insects with their sticky tongue. Scientists have observed aardvarks devouring as many as 50,000 insects in a single night!

By nature, aardvarks tend to be reclusive. They are nocturnal creatures that build elaborate individual burrows of up to 40 feet in length in their home terrain, used to search for food and provide temporary shelter. Mothers make use of burrows as a more permanent home when giving birth to their young.

Currently, aardvarks are not considered an endangered species. However, they are still targeted by hunters for their exquisite cylindrical teeth, which are often used for decorative purposes. Matt Hutchinson was the production editor for Jakarta Commons Cookbook. Octal Publishing, Inc. provided production services. Marlowe Shaeffer, Sarah Sherman, and Darren Kelly provided quality control.

Emma Colby designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from Illustrated Natural History. Clay Fernald produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.

David Futato designed the interior layout. This book was converted by Julie Hawks to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Lesley Borash using Macromedia FreeHand MX and Adobe Photoshop CS. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Sanders Kleinfeld.

  • Book cover of Jakarta Commons Cookbook