Revision 20386
branches/gvSIG-mobile/libCompatMobile/src/org/gvsig/compat/StringUtils.java | ||
---|---|---|
62 | 62 |
* $Log$ |
63 | 63 |
* |
64 | 64 |
*/ |
65 |
/**************************************************************** |
|
66 |
* |
|
67 |
* StringUtils |
|
68 |
* This class includes some methods needed by gvSIG Mobile that the KVM |
|
65 |
/** |
|
66 |
* StringUtils is a class that includes some missing "java.lang.String" methods needed by gvSIG Mobile |
|
67 |
* because are very used by many gvSIG classes. |
|
69 | 68 |
* hasn't in "java.lang.String" |
70 | 69 |
* |
71 |
* PRODEVELOP S.L. |
|
72 |
* @author Carlos S?nchez Peri??n (csanchez@prodevelop.es)
|
|
73 |
* |
|
74 |
****************************************************************/
|
|
70 |
* @PRODEVELOP S.L.
|
|
71 |
* @author Carlos S?nchez Peri??n (csanchez@prodevelop.es) |
|
72 |
* @version %I%, %G%
|
|
73 |
*/ |
|
75 | 74 |
public class StringUtils { |
76 |
/* |
|
77 |
* splitString(String,String) : static method compatible with java.lang.String.split(String sep) |
|
78 |
*/ |
|
75 |
/** |
|
76 |
* Splits an String by seeking for a pattern into it, this pattern could be another sub-string |
|
77 |
* when this sub-string is finded out into the input string, the string is splited in two, the first one is formed from |
|
78 |
* the beggining to the pattern and goes to the first place into the String array, the second one is formed form the end |
|
79 |
* of the pattern to the end of the string and goes to the second free position into the string array and is seeked again |
|
80 |
* to find more patterns. This process is repited until the end of the string. |
|
81 |
* <p> |
|
82 |
* The return is one array with sub-strings that none of them contains the pattern string. |
|
83 |
* |
|
84 |
* @param input The input string to be splited by a pattern. |
|
85 |
* @param pattern The pattern to split the string, could be one char or another string. |
|
86 |
* |
|
87 |
* @return String[] wich contains the input splited "n" times. |
|
88 |
* |
|
89 |
* @see java.lang.String.split(String sep) original method. |
|
90 |
* @since 1.0 |
|
91 |
*/ |
|
79 | 92 |
public static String[] splitString(String input, String sep) { |
80 | 93 |
return Pattern.compile(sep).split(input, 0); |
81 | 94 |
} |
branches/gvSIG-mobile/libCompatMobile/src/org/gvsig/compat/FileUtils.java | ||
---|---|---|
5 | 5 |
import java.io.EOFException; |
6 | 6 |
import java.io.File; |
7 | 7 |
import java.io.FileInputStream; |
8 |
import java.io.FileNotFoundException; |
|
9 | 8 |
import java.io.IOException; |
10 | 9 |
import java.nio.ByteBuffer; |
11 | 10 |
import java.nio.channels.FileChannel; |
branches/gvSIG-mobile/libCompatMobile/build.xml | ||
---|---|---|
1 |
<project name="libCompatMobile" default="build-desktop" basedir=".."> |
|
2 |
<description> |
|
3 |
It installs the GPE driver in gvSIGMobile |
|
4 |
</description> |
|
5 |
<!-- set global properties for this build --> |
|
6 |
<property name="compatdir" location="libCompatMobile" /> |
|
7 |
<property name="libCompatjars" value="${eclipseClasspath}"/> |
|
8 |
<target name="build-mobile"> |
|
9 |
<depend srcdir="${compatdir}/src" destdir="${compatdir}/bin"></depend> |
|
10 |
<javac srcdir="${compatdir}/src" destdir="${compatdir}/bin" |
|
11 |
classpath="${FMapGpejars}"> |
|
12 |
</javac> |
|
13 |
<mkdir dir="${compatdir}/lib"/> |
|
14 |
<jar destfile="${compatdir}/lib/org.gvsig.compat-mobile.jar" basedir="${compatdir}/bin"></jar> |
|
15 |
</target> |
|
16 |
<target name="build-desktop"> |
|
17 |
<depend srcdir="${compatdir}/src" destdir="${compatdir}/bin"></depend> |
|
18 |
<javac srcdir="${compatdir}/src" destdir="${compatdir}/bin" |
|
19 |
classpath="${FMapGpejars}"> |
|
20 |
</javac> |
|
21 |
<mkdir dir="${compatdir}/lib"/> |
|
22 |
<jar destfile="${compatdir}/lib/org.gvsig.compat-desktop.jar" basedir="${compatdir}/bin"></jar> |
|
23 |
</target> |
|
24 |
</project> |
Also available in: Unified diff