org.nuxeo.runtime.jboss.deployer
Class Utils
java.lang.Object
org.nuxeo.runtime.jboss.deployer.Utils
public class Utils
- extends java.lang.Object
- Author:
- Bogdan Stefanescu
Constructor Summary |
Utils()
|
Method Summary |
static java.lang.String |
expandVars(java.lang.String expression,
java.util.Map<?,?> properties)
Expands any variable found in the given expression with the values in the
given map. |
static java.io.File |
getFile(java.net.URL url)
|
static java.io.File |
getFile(org.jboss.virtual.VirtualFile vf)
Try to convert a virtual file to a real java file. |
static java.io.File |
getJarFile(java.net.URL url)
|
static java.io.File |
getRealHomeDir(org.jboss.virtual.VirtualFile vf)
|
static java.io.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 java.lang.String[] |
split(java.lang.String str,
char delimiter,
boolean trim)
|
static java.io.File |
tryGetFile(java.net.URL url)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
tryGetFile
public static java.io.File tryGetFile(java.net.URL url)
throws java.lang.Exception
- Throws:
java.lang.Exception
getFile
public static java.io.File getFile(java.net.URL url)
throws java.lang.Exception
- Throws:
java.lang.Exception
getJarFile
public static java.io.File getJarFile(java.net.URL url)
throws java.lang.Exception
- Throws:
java.lang.Exception
getFile
public static java.io.File getFile(org.jboss.virtual.VirtualFile vf)
throws java.lang.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.
- Parameters:
vf
-
- Returns:
-
- Throws:
java.lang.Exception
getRealHomeDir
public static java.io.File getRealHomeDir(org.jboss.virtual.VirtualFile vf)
throws java.lang.Exception
- Throws:
java.lang.Exception
getRealHomeDir
public static java.io.File getRealHomeDir(org.jboss.virtual.VirtualFile vf,
long lastModified)
throws java.lang.Exception
- Unzip only if the given lastModified is greater than the already unzipped
home (if any). Must use a vlue of 0 if the lastModified time is not
known.
- Parameters:
vf
- lastModified
-
- Returns:
-
- Throws:
java.lang.Exception
split
public static java.lang.String[] split(java.lang.String str,
char delimiter,
boolean trim)
expandVars
public static java.lang.String expandVars(java.lang.String expression,
java.util.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 expandproperties
- a map containing variables
Copyright © 2010 Nuxeo SAS. All Rights Reserved.