Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.jboss.deployer
Class Utils

java.lang.Object
  extended by org.nuxeo.runtime.jboss.deployer.Utils

public class Utils
extends Object

Author:
Bogdan Stefanescu

Method Summary
static String expandVars(String expression, Map<?,?> properties)
          Expands any variable found in the given expression with the values in the given map.
static File getFile(URL url)
           
static File getFile(org.jboss.virtual.VirtualFile vf)
          Try to convert a virtual file to a real java file.
static File getJarFile(URL url)
           
static File getRealHomeDir(org.jboss.virtual.VirtualFile vf)
           
static File getRealHomeDir(org.jboss.virtual.VirtualFile vf, long lastModified)
          Unzip only if the given lastModified is greater than the already unzipped home (if any).
static String[] split(String str, char delimiter, boolean trim)
           
static File tryGetFile(URL url)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

tryGetFile

public static File tryGetFile(URL url)
                       throws Exception
Throws:
Exception

getFile

public static File getFile(URL url)
                    throws Exception
Throws:
Exception

getJarFile

public static File getJarFile(URL url)
                       throws Exception
Throws:
Exception

getFile

public static File getFile(org.jboss.virtual.VirtualFile vf)
                    throws Exception
Try to convert a virtual file to a real java file. An IOException is thrown if the virtual file cannot be converted to a java file. Virtual files that point to a zip entry will return the zip file containing the entry.

Throws:
Exception

getRealHomeDir

public static File getRealHomeDir(org.jboss.virtual.VirtualFile vf)
                           throws Exception
Throws:
Exception

getRealHomeDir

public static File getRealHomeDir(org.jboss.virtual.VirtualFile vf,
                                  long lastModified)
                           throws Exception
Unzip only if the given lastModified is greater than the already unzipped home (if any). Must use a value of 0 if the lastModified time is not known.

Throws:
Exception

split

public static String[] split(String str,
                             char delimiter,
                             boolean trim)

expandVars

public static String expandVars(String expression,
                                Map<?,?> properties)
Expands any variable found in the given expression with the values in the given map.

The variable format is ${property_key}.

Parameters:
expression - the expression to expand
properties - a map containing variables

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.