|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.modules.vcscore.util.VcsUtilities
Miscelaneous stuff.
Constructor Summary | |
VcsUtilities()
|
Method Summary | |
static Map |
addEnvVars(Map envVars,
Hashtable vars,
String varEnvPrefix)
Add environment variables from the variables table. |
static Map |
addEnvVars(Map envVars,
Hashtable vars,
String varEnvPrefix,
String varEnvRemovePrefix)
Add environment variables from the variables table and remove any variables denoted with a remove prefix from the environment. |
static boolean |
areQuotedStringsContainedInSet(String quotedStr,
Set set)
Find out, whether all string from the field of quoted strings are contained in a set of strings. |
static String |
array2string(String[] sa)
|
static String |
array2stringNl(String[] sa)
Converts the array of strings into a string containing the elements separated by new line. |
static String |
arrayToQuotedString(String[] sa,
boolean unixShell,
String quotation)
|
static String |
arrayToQuotedStrings(String[] sa)
Get the comma-separated quoted strings from an array of strings. |
static String |
arrayToSpaceSeparatedString(String[] sa)
|
static String |
arrayToString(String[] sa)
|
static void |
centerWindow(Window w)
|
static int |
charCount(String str,
char c)
Returns the number of characters in the specified string. |
static String |
computeRegularExpressionFromIgnoreList(List ignoreList)
|
static FileObject[] |
convertFileObjects(FileObject[] originals)
Performs the conversion from the Fileobjects retrieved from nodes to the real underlying versioning filesystem's fileobjects. |
static File |
createTMP()
Creates a temporary directory. |
static String |
createUniqueName(String name,
Collection names)
Create a unique name, that does not occure in the collections of names. |
static Object |
decodeValue(String value)
Creates serialized object, which was encoded in HEX format |
static boolean |
deleteRecursive(File dir)
|
static String |
encodeValue(Object value)
Encodes Object into String encoded in HEX format |
static Frame |
getAncestor(JComponent c,
Dialog[] dialog_ptr)
Get the top level ancestor of a component which is a Frame or Dialog. |
static String |
getBundleString(String str)
Get a string from a resource bundle. |
static String |
getBundleString(String[] resourceBundles,
String str)
Get a string where some of it's parts can be loaded from one or more resource bundles. |
static String |
getBundleString(String[] resourceBundles,
String str,
String suffix)
Get a string where some of it's parts can be loaded from one or more resource bundles. |
static String |
getDirNamePart(String path)
|
static String[] |
getEnvString(Map envVars)
|
static String |
getFileNamePart(String path)
|
static FileObject |
getMainFileObject(FileObject fo)
Get the main FileObject that resides on MasterFS for the given FileObject that can be on some delegate FS. |
static int |
getPairIndex(String str,
int from,
char p1,
char p2)
Get the pair index of a given character. |
static String[] |
getQuotedArguments(String str)
Converts a String of quoted values delimited by spaces or any other white characters to an array of String values. |
static String[] |
getQuotedStrings(String str)
Converts a String of quoted values delimited by commas to an array of String values. |
static String[] |
getQuotedStringsWithPairedCharacters(String str,
char p1,
char p2)
Converts a String of quoted values delimited by commas to an array of String values. |
static ClassLoader |
getSFSClassLoader()
Get the class loader, that loads classes from SystemFileSystem. |
static Map |
getSystemEnvVars()
Get just the system environment variables. |
static boolean |
isSetContainedInQuotedStrings(String quotedStr,
Set set)
Find out, whether all members of a set of strings are contained in the field of quoted strings. |
static boolean |
matchQuotedStringToSet(String quotedStr,
Set set)
Find out, whether some string from the field of quoted strings is contained in a set of strings. |
static int |
max3(int v1,
int v2,
int v3)
|
static int |
max7(int v1,
int v2,
int v3,
int v4,
int v5,
int v6,
int v7)
|
static String[] |
mergeArrays(String[] sa1,
String[] sa2)
|
static int |
numChars(String str,
char c)
Count the number of occurences of a character in the specified String. |
static void |
removeEnterFromKeymap(JTextComponent component)
|
static void |
removeKeys(HashMap table,
HashMap toRemove)
Removes all keys from the first Hashtable which are defined in the second one. |
static String |
replaceBackslashDollars(String s)
|
static String |
toSpaceSeparatedString(Vector v)
|
static boolean |
withinRange(int min,
int val,
int max)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VcsUtilities()
Method Detail |
public static int max3(int v1, int v2, int v3)
public static int max7(int v1, int v2, int v3, int v4, int v5, int v6, int v7)
public static boolean withinRange(int min, int val, int max)
public static int getPairIndex(String str, int from, char p1, char p2)
i.e. getPairIndex("(a-(b+c)+d)", 1, '(', ')') gives 10 -- the position of the last ')' <\p>
str
- the String to searchfrom
- the initial positionp1
- the pair characterp2
- the character to search
public static int charCount(String str, char c)
str
- the stringc
- the characterpublic static String arrayToString(String[] sa)
public static String array2string(String[] sa)
public static String array2stringNl(String[] sa)
public static String arrayToSpaceSeparatedString(String[] sa)
public static String arrayToQuotedString(String[] sa, boolean unixShell, String quotation)
public static String arrayToQuotedStrings(String[] sa)
public static String replaceBackslashDollars(String s)
public static String[] mergeArrays(String[] sa1, String[] sa2)
public static String toSpaceSeparatedString(Vector v)
public static String[] getQuotedStrings(String str)
public static String[] getQuotedStringsWithPairedCharacters(String str, char p1, char p2)
public static String[] getQuotedArguments(String str)
public static boolean matchQuotedStringToSet(String quotedStr, Set set)
quotedStr
- the field of quoted strings, can be null
set
- the set of strings
public static boolean areQuotedStringsContainedInSet(String quotedStr, Set set)
quotedStr
- the field of quoted strings, can be null
set
- the set of strings
public static boolean isSetContainedInQuotedStrings(String quotedStr, Set set)
quotedStr
- the field of quoted strings, can be null
set
- the set of strings, can be null
public static ClassLoader getSFSClassLoader()
public static String getBundleString(String str)
str
- the string
public static String getBundleString(String[] resourceBundles, String str)
resourceBundles
- The array of class names or paths to the resource bundlesstr
- the string
public static String getBundleString(String[] resourceBundles, String str, String suffix)
resourceBundles
- The array of class names or paths to the resource bundlesstr
- the key identifier (bundle, key string encoded pair)suffix
- key suffix
public static String computeRegularExpressionFromIgnoreList(List ignoreList)
public static String getDirNamePart(String path)
public static String getFileNamePart(String path)
public static Frame getAncestor(JComponent c, Dialog[] dialog_ptr)
c
- The componentdialog_ptr
- The array in which the parent dialog is returned, if any
public static void centerWindow(Window w)
public static boolean deleteRecursive(File dir)
public static void removeEnterFromKeymap(JTextComponent component)
public static int numChars(String str, char c)
str
- the String to count the character inc
- the character to countpublic static void removeKeys(HashMap table, HashMap toRemove)
public static Map getSystemEnvVars()
public static Map addEnvVars(Map envVars, Hashtable vars, String varEnvPrefix)
envVars
- the map of environment variables. The additional variables will be
added to it.vars
- the table of variables from which the additional environment variables
will be added to envVars
. Only variables with a given prefix
will be added.varEnvPrefix
- the prefix of variables, which are considered as environmental
public static Map addEnvVars(Map envVars, Hashtable vars, String varEnvPrefix, String varEnvRemovePrefix)
envVars
- the map of environment variables. The additional variables will be
added to it.vars
- the table of variables from which the additional environment variables
will be added to envVars
. Only variables with a given prefix
will be added.varEnvPrefix
- the prefix of variables, which are considered as environmentalvarEnvRemovePrefix
- the prefix of variables, which will be removed from the
environment.
public static String[] getEnvString(Map envVars)
public static File createTMP()
public static String createUniqueName(String name, Collection names)
name
- the base namenames
- the collection of names
public static FileObject[] convertFileObjects(FileObject[] originals)
public static FileObject getMainFileObject(FileObject fo)
public static String encodeValue(Object value) throws IOException
value
- Object, which will be encoded
IOException
public static Object decodeValue(String value) throws IOException
value
- Encoded serialized object in HEX format
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |