public class RAConfig extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
A3SERVERS_XML |
private static int |
BUFFER_SIZE |
private static String |
confDir |
private static boolean |
debug |
private static String |
JORAMADMIN_CFG |
private static String |
JORAMADMIN_XML |
private static String |
RA_PROPERTIES |
private static String |
RA_XML |
private static String |
tmpDir |
private static boolean |
verbose |
Modifier | Constructor and Description |
---|---|
private |
RAConfig() |
Modifier and Type | Method and Description |
---|---|
private boolean |
copy(String file1,
String file2) |
private void |
createFile(String path,
InputStream is)
create the filename in the tmp directory
by writing the input stream in the file name.
|
private void |
createFile(String path,
String input)
create the filename in the tmp directory,
by writing the input in the file name.
|
private void |
createRaProperties(String rarName)
create ra.properties
build from the ra.xml file from RAR.
|
private void |
dump(InputStream is,
OutputStream os)
write the inputstream in outputstream.
|
private InputStream |
extractFromJAR(String fileName,
InputStream reader)
Extract fileName from the JAR file.
|
private void |
extractFromJAR(String jarName,
String fileName)
Extract config files from the JAR file.
|
private void |
extractFromRAR(String rarName,
String fileName)
Extract the fileName from the RAR file.
|
private String |
getFileName(String path) |
static void |
main(String[] args) |
private String |
parse(InputStream is)
parse input stream.
|
private String |
update(InputStream is,
Map map)
update input stream with map value.
|
private void |
updateA3Servers(String rarName,
String hostName,
String port,
short serverId)
update A3SERVERS_XML file
|
private void |
updateHostPort(String rarName,
String hostName,
String port,
short serverId)
update host/port in ra.xml and a3server.xml in RAR.
|
private void |
updateJoramAdminCfg(String hostName,
String port) |
private void |
updateJoramAdminXml(String hostName,
String port) |
private void |
updateRAR(String raProperties,
boolean updateA3servers)
update RA_XML file
|
private void |
updateRootName(String rarName,
String rootName,
String rootPasswd,
String identityClass)
update host/port in ra.xml and a3server.xml in RAR.
|
private void |
updateZIP(String zipName,
String path,
String newFileName,
String oldFileName)
Update the RAR file
|
static void |
usage()
Usage of RAConfig.
|
private static final String RA_XML
private static final String A3SERVERS_XML
private static final String RA_PROPERTIES
private static final String JORAMADMIN_CFG
private static final String JORAMADMIN_XML
private static final int BUFFER_SIZE
private static boolean debug
private static boolean verbose
private static String confDir
private static String tmpDir
public static void usage()
private void createRaProperties(String rarName) throws Exception
rarName
- String input RAR file nameException
- to throw if an Exception occursprivate void extractFromRAR(String rarName, String fileName) throws Exception
rarName
- RAR file namefileName
- file nameException
- to throw if an Exception occursprivate InputStream extractFromJAR(String fileName, InputStream reader) throws Exception
fileName
- file namereader
- Input streamException
- to throw if an Exception occursprivate void extractFromJAR(String jarName, String fileName) throws Exception
jarName
- JAR file namefileName
- file to be extractException
- to throw if an Exception occursprivate void dump(InputStream is, OutputStream os) throws Exception
is
- input streamos
- output streamException
- to throw if an Exception occursprivate void createFile(String path, InputStream is) throws Exception
path
- new fileis
- input streamException
- to throw if an Exception occursprivate void createFile(String path, String input) throws Exception
path
- new fileinput
- string to writeException
- to throw if an Exception occursprivate String parse(InputStream is) throws Exception
is
- input streamException
- to throw if an Exception occursprivate String update(InputStream is, Map map) throws Exception
is
- input streammap
- map value (see ra.properties)Exception
- to throw if an Exception occursprivate void updateHostPort(String rarName, String hostName, String port, short serverId) throws Exception
rarName
- rar file namehostName
- new host nameport
- new portserverId
- server IdException
private void updateRootName(String rarName, String rootName, String rootPasswd, String identityClass) throws Exception
rarName
- rar file namerootName
- new root namerootPasswd
- new RootPasswdidentityClass
- new IdentityClassserverId
- server IdException
private void updateA3Servers(String rarName, String hostName, String port, short serverId) throws Exception
rarName
- rar file namehostName
- new host nameport
- new portserverId
- server IdException
private void updateJoramAdminCfg(String hostName, String port) throws Exception
Exception
private void updateJoramAdminXml(String hostName, String port) throws Exception
Exception
private void updateRAR(String raProperties, boolean updateA3servers) throws Exception
raProperties
- ra.properties fileException
private void updateZIP(String zipName, String path, String newFileName, String oldFileName) throws Exception
zipName
- String JAR or RAR filepath
- path in JAR or RAR filenewFileName
- add new filenameoldFileName
- remove old file from JAR or RARException
Copyright © 2015 ScalAgent D.T.. All Rights Reserved.