it.andynaz.utils
@Deprecated public class UtilsXML extends Object
UtilsIO
class can be used.Modifier | Constructor and Description |
---|---|
private |
UtilsXML()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static String |
readTag(File file,
String tag)
Deprecated.
Read the content of a tag from an XML file.
|
static String |
readTag(String fileContent,
String tag)
Deprecated.
Read the content of a tag from an XML file.
|
static void |
replaceTag(File file,
String tag,
String content)
Deprecated.
Replace the content of a tag.
|
static String |
replaceTag(String fileContent,
String tag,
String content)
Deprecated.
Replace the content of a tag.
|
public static void replaceTag(File file, String tag, String content)
replaceTag(java.lang.String, java.lang.String,
java.lang.String)
method.
The method does not throw any Exception; if an error occours it writes a log on the standard output.
file
- an XML filetag
- tag namecontent
- new tag contentpublic static String replaceTag(String fileContent, String tag, String content)
Note: only the first occourrence will be replaced.
fileContent
- content of the XML filetag
- tag namecontent
- new tag contentpublic static String readTag(File file, String tag) throws IOException
readTag(java.lang.String, java.lang.String)
method.
Note: only the first occourrence of the tag is read.
file
- an XML filetag
- tag nameIOException
- if I/O errors occourpublic static String readTag(String fileContent, String tag)
Note: only the first occourrence of the tag is read.
fileContent
- content of an XML filetag
- tag nameNullPointerException
- if the tag parameter is empty© 2013 andynaz - http://andynaz.altervista.org