org.apache.felix.fileinstall.internal
Class Util

java.lang.Object
  extended by org.apache.felix.fileinstall.internal.Util

public class Util
extends Object


Constructor Summary
Util()
           
 
Method Summary
static int getGlobalLogLevel(BundleContext context)
           
static void jarDir(File directory, File zipName)
          Jar up a directory
static void jarDir(File directory, OutputStream os)
           
static long loadChecksum(Bundle b, BundleContext bc)
          Returns the stored checksum of the bundle.
static void log(BundleContext context, int logLevel, int msgLevel, String message, Throwable e)
          Log a message and optional throwable.
static void storeChecksum(Bundle b, long checksum, BundleContext bc)
          Stores the checksum into a bundle data file.
static void zipDir(File directory, ZipOutputStream zos, String path, Set exclusions)
          Zip up a directory path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getGlobalLogLevel

public static int getGlobalLogLevel(BundleContext context)

log

public static void log(BundleContext context,
                       int logLevel,
                       int msgLevel,
                       String message,
                       Throwable e)
Log a message and optional throwable. If there is a log service we use it, otherwise we log to the console

Parameters:
message - The message to log
e - The throwable to log

jarDir

public static void jarDir(File directory,
                          File zipName)
                   throws IOException
Jar up a directory

Parameters:
directory -
zipName -
Throws:
IOException

jarDir

public static void jarDir(File directory,
                          OutputStream os)
                   throws IOException
Throws:
IOException

zipDir

public static void zipDir(File directory,
                          ZipOutputStream zos,
                          String path,
                          Set exclusions)
                   throws IOException
Zip up a directory path

Parameters:
directory -
zos -
path -
exclusions -
Throws:
IOException

storeChecksum

public static void storeChecksum(Bundle b,
                                 long checksum,
                                 BundleContext bc)
Stores the checksum into a bundle data file.

Parameters:
b - The bundle whose checksum must be stored
checksum - the lastModified date to be stored in bc
bc - the FileInstall's bundle context where to store the checksum.

loadChecksum

public static long loadChecksum(Bundle b,
                                BundleContext bc)
Returns the stored checksum of the bundle.

Parameters:
b - the bundle whose checksum must be returned
bc - the FileInstall's bundle context.
Returns:
the stored checksum of the bundle


Copyright © 2011 Apache Software Foundation. All Rights Reserved.