• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
VersionInfo Class Reference

Provides access to version information for HTTP components. More...

Description

Instances of this class provide version information for a single module or informal unit, as explained here. Static methods are used to extract version information from property files that are automatically packaged with HTTP component release JARs.
All available version information is provided in strings, where the string format is informal and subject to change without notice. Version information is provided for debugging output and interpretation by humans, not for automated processing in applications.

Author
Oleg Kalnichevski
and others

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

final String getPackage ()
 Obtains the package name. More...
 
final String getModule ()
 Obtains the name of the versioned module or informal unit. More...
 
final String getRelease ()
 Obtains the release of the versioned module or informal unit. More...
 
final String getTimestamp ()
 Obtains the timestamp of the versioned module or informal unit. More...
 
final String getClassloader ()
 Obtains the classloader used to read the version information. More...
 
String toString ()
 Provides the version information in human-readable format. More...
 

Static Public Member Functions

static final VersionInfo[] loadVersionInfo (String[] pckgs, ClassLoader clsldr)
 Loads version information for a list of packages. More...
 
static final VersionInfo loadVersionInfo (final String pckg, ClassLoader clsldr)
 Loads version information for a package. More...
 

Static Public Attributes

static final String UNAVAILABLE = "UNAVAILABLE"
 A string constant for unavailable information. More...
 
static final String VERSION_PROPERTY_FILE = "version.properties"
 The filename of the version information files. More...
 

Protected Member Functions

 VersionInfo (String pckg, String module, String release, String time, String clsldr)
 Instantiates version information. More...
 

Static Protected Member Functions

static final VersionInfo fromMap (String pckg, Map info, ClassLoader clsldr)
 Instantiates version information from properties. More...
 

Constructor & Destructor Documentation

◆ VersionInfo()

VersionInfo ( String  pckg,
String  module,
String  release,
String  time,
String  clsldr 
)
protected
Parameters
pckgthe package
modulethe module, or null
releasethe release, or null
timethe build time, or null
clsldrthe class loader, or null

Member Function Documentation

◆ getPackage()

final String getPackage ( )

The package name identifies the module or informal unit.

Returns
the package name, never null

◆ getModule()

final String getModule ( )

This data is read from the version information for the package.

Returns
the module name, never null

◆ getRelease()

final String getRelease ( )

This data is read from the version information for the package.

Returns
the release version, never null

◆ getTimestamp()

final String getTimestamp ( )

This data is read from the version information for the package.

Returns
the timestamp, never null

◆ getClassloader()

final String getClassloader ( )

This is just the toString output of the classloader, since the version information should not keep a reference to the classloader itself. That could prevent garbage collection.

Returns
the classloader description, never null

◆ toString()

String toString ( )
Returns
a string holding this version information

◆ loadVersionInfo() [1/2]

static final VersionInfo [] loadVersionInfo ( String[]  pckgs,
ClassLoader  clsldr 
)
static
Parameters
pckgsthe packages for which to load version info
clsldrthe classloader to load from, or null for the thread context classloader
Returns
the version information for all packages found, never null

◆ loadVersionInfo() [2/2]

static final VersionInfo loadVersionInfo ( final String  pckg,
ClassLoader  clsldr 
)
static
Parameters
pckgthe package for which to load version information, for example "org.apache.http". The package name should NOT end with a dot.
clsldrthe classloader to load from, or null for the thread context classloader
Returns
the version information for the argument package, or null if not available

◆ fromMap()

static final VersionInfo fromMap ( String  pckg,
Map  info,
ClassLoader  clsldr 
)
staticprotected
Parameters
pckgthe package for the version information
infothe map from string keys to string values, for example java.util.Properties
clsldrthe classloader, or null
Returns
the version information

Member Data Documentation

◆ UNAVAILABLE

final String UNAVAILABLE = "UNAVAILABLE"
static

◆ VERSION_PROPERTY_FILE

final String VERSION_PROPERTY_FILE = "version.properties"
static