ACS AEM Commons Utils APIs

Available since version 1.0.0

Purpose

Provide common utility functionality across projects.

Overview

The best overview are the ACS AEM Commons Utils JavaDocs.

Characteristics of the ACS AEM Commons Utils are:

  • Static Java classes
  • Do NOT have mutable state
  • Do NOT have inherent access to OSGi/JCR/Sling context and typically do not require it
    • Any required context must be passed into the utility method

ACS AEM Commons Utils List

CookieUtil
Creation, deletion and modification of HTTP Cookies
OsgiPropertyUtil
Parsing OSGi component property String values into "complex" data structures (usually Maps or Key/Value pairs)
PathInfoUtil
Getting values from a HTTP Request's Path and Query Params
ResourceDataUtil

Gets less-common data renditions from Resources including:

  • Getting the rendition of a resource as a String
  • Getting a InputStream representation of a nt:file
  • Getting a String representation of a nt:file
TemplateUtil
Utility methods for working with CQ Templates.
TextUtil
Gets default values, non-blank values. See also CQ TextUtils and Apache Commons StringUtils.
TypeUtil
Intelligently determines Java object types and converts between types (including "unusual" transformations like Array to Map)
ThreadContextClassLoaderTaskExecutor (since 1.5.0)
Execute a task (using the Callabale interface) after setting the Thread Context ClassLoader, and then resetting it upon completion of the task.