[izpack-changes] r1564 - izpack-src/trunk/src/lib/com/izforge/izpack/util
noreply at berlios.de
noreply at berlios.de
Wed Sep 6 22:27:45 CEST 2006
Author: eppelman
Date: 2006-09-06 22:27:44 +0200 (Wed, 06 Sep 2006)
New Revision: 1564
Modified:
izpack-src/trunk/src/lib/com/izforge/izpack/util/StringTool.java
Log:
-implemented the X-KDE subsitute user - shortcut attribute (see Unix_shortcutSpec.xml).
-write Desktop shortcuts to all known local and ypbinded users "desktop" folders.
-write common shortcuts to the new freedesktop.org common "/usr/share/applications"
and "/usr/share/pixmaps" folders to display these in the commons [start].menu
Here: maintenance
Modified: izpack-src/trunk/src/lib/com/izforge/izpack/util/StringTool.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/util/StringTool.java 2006-09-06 20:25:31 UTC (rev 1563)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/util/StringTool.java 2006-09-06 20:27:44 UTC (rev 1564)
@@ -168,34 +168,36 @@
{
return (normalizePath(destination, null));
}
-
+
/**
- * Converts an String Array to a space separated String w/o any check
+ * Converts an String Array to a space separated String w/o any check
+ *
* @param args The StringArray
* @return the space separated result.
*/
- public static String stringArrayToSpaceSeparatedString( String[] args )
+ public static String stringArrayToSpaceSeparatedString(String[] args)
{
- String result = "";
- for( int idx = 0; idx < args.length; idx++ )
+ String result = "";
+ for (int idx = 0; idx < args.length; idx++)
{
- result += args[ idx ]+ " ";
+ result += args[idx] + " ";
}
- return result;
+ return result;
}
public static String getPlatformEncoding()
{
// TODO Auto-generated method stub
- return System.getProperty( "file.encoding" );
+ return System.getProperty("file.encoding");
}
+
public static String UTF16()
{
return "UTF-16";
}
/**
- * Transforms a (Array)List of Strings into a printable Stringlist
+ * Transforms a (Array)List of Strings into a line.separator="\n" separated Stringlist.
*
* @param aStringList
*
@@ -203,13 +205,28 @@
*/
public static String stringArrayListToString(ArrayList aStringList)
{
+ return stringArrayListToString(aStringList, null);
+ }
+
+ /**
+ * Transforms a (Array)List of Strings into an aLineSeparator separated Stringlist.
+ *
+ * @param aStringList
+ *
+ * @return a printable list
+ */
+ public static String stringArrayListToString(ArrayList aStringList, String aLineSeparator)
+ {
+ String LineSeparator = aLineSeparator;
+ if (LineSeparator == null) LineSeparator = System.getProperty("line.separator", "\n");
+
StringBuffer temp = new StringBuffer();
-
+
for (int idx = 0; idx < aStringList.size(); idx++)
{
- temp.append(aStringList.get(idx)).append("\n");
+ temp.append(aStringList.get(idx)).append(LineSeparator);
}
-
+
return temp.toString();
}
@@ -236,7 +253,8 @@
*/
public static boolean startsWithIgnoreCase(String str, String prefix)
{
- return (str != null) && (prefix!=null) && str.toUpperCase().startsWith(prefix.toUpperCase());
+ return (str != null) && (prefix != null)
+ && str.toUpperCase().startsWith(prefix.toUpperCase());
}
-
+
}
More information about the izpack-changes
mailing list