/** Returns the system specific file.separator delimited path to the asadmin script. Any changes to file layout should * be reflected here. The path will contain '/' as the separator character, regardless of operating * platform. Never returns a null. Assumes the the property "INSTALL_ROOT_PROPERTY" is set in the VM * before calling this. As of now (September 2005) all the server instances and asadmin VM itself has * this property set. The method does not guarantee that the script exists on the given system. It should * only be used when caller wants to know the location of the script. Caller should make sure it exists. * @return String representing the Path to asadmin script. Might return a string beginning with "null", if * the INSTALL_ROOT_PROPERTY is not defined */ public static final String getAsAdminScriptLocation() { return getAsAdminScriptLocation(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY)); }
/** Returns the default value (as would appear in the domain.xml on installation) * of docroot of a virtual server, as a String. Never returns a null. * Returned String contains no backslashes. * Note that it is <b> not <b> the absolute value of the path on a file system. */ public static final String getDocRootDefaultValue() { final StringBuffer sb = new StringBuffer(getPropertyAsValue(INSTANCE_ROOT_PROPERTY)); return ( sb.append("/docroot").toString() ); }
/** Returns the string removing the "system-property syntax" from it. * If the given string is not in "system-property syntax" the same string is returned. * The "system-propery syntax" is "${...}" * The given String may not be null. * The returned String may be an empty String, if it is of the form "${}" (rarely so). */ public static final String unSystemProperty(final String sp) { if (sp == null) throw new IllegalArgumentException ("null_arg"); String ret = sp; if (isSystemPropertySyntax(sp)) { ret = sp.substring(2, sp.length() - 1); } return ( ret ); }
List<String> fullcommand = new ArrayList<String>(); String installDir = node.getInstallDirUnixStyle() + "/" + SystemPropertyConstants.getComponentName(); if (!StringUtils.ok(installDir)) { throw new IllegalArgumentException("Node does not have an installDir"); File asadmin = new File(SystemPropertyConstants.getAsAdminScriptLocation(installDir)); fullcommand.add(asadmin.getAbsolutePath()); fullcommand.addAll(args);
try { String asadmin = Constants.v4 ? "/lib/nadmin' version --local --terse" : "/bin/asadmin' version --local --terse"; String cmd = "'" + sshInstallDir + "/" + SystemPropertyConstants.getComponentName() + asadmin; int status = sshLauncher.runCommand(cmd, outStream); if (status == 0) {
public static final String getAsAdminScriptLocation(String installRoot) { return getAdminScriptLocation(installRoot); }
SystemPropertyConstants.getComponentName(); if (!StringUtils.ok(installDir)) { throw new IllegalArgumentException("Node does not have an installDir");
public static final String getAsAdminScriptLocation(String installRoot) { return getAdminScriptLocation(installRoot); }
public LocalAdminCommand(String command, String... args) { asadmin = new File(SystemPropertyConstants.getAsAdminScriptLocation()); cmds.add(asadmin.getAbsolutePath()); cmds.add(command); if (args != null && args.length > 0) cmds.addAll(Arrays.asList(args)); }
/** Returns the default value (as would appear in the domain.xml on installation) * of file where the acess log of a virtual server is stored, as a String. Never returns a null. * Returned String contains no backslashes. * Note that it is <b> not <b> the absolute value of the path on a file system. */ public static final String getAccessLogDefaultValue() { final StringBuffer sb = new StringBuffer(getPropertyAsValue(INSTANCE_ROOT_PROPERTY)); return ( sb.append("/logs/access").toString() ); }
/** Returns the string removing the "system-property syntax" from it. * If the given string is not in "system-property syntax" the same string is returned. * The "system-propery syntax" is "${...}" * The given String may not be null. * The returned String may be an empty String, if it is of the form "${}" (rarely so). */ public static final String unSystemProperty(final String sp) { if (sp == null) throw new IllegalArgumentException ("null_arg"); String ret = sp; if (isSystemPropertySyntax(sp)) { ret = sp.substring(2, sp.length() - 1); } return ( ret ); }
+ sshInstallDir + "/" + SystemPropertyConstants.getComponentName() + "/lib"); try { sftpClient.chmod((sshInstallDir + "/" + SystemPropertyConstants.getComponentName() + "/lib/nadmin"), 0755); if (logger.isLoggable(Level.FINER)) logger.finer("Fixed file permission for nadmin under " + host + ":" + sshInstallDir + "/" + SystemPropertyConstants.getComponentName() + "/lib/nadmin");
/** Returns the system specific file.separator delimited path to the asadmin script. Any changes to file layout should * be reflected here. The path will contain '/' as the separator character, regardless of operating * platform. Never returns a null. Assumes the the property "INSTALL_ROOT_PROPERTY" is set in the VM * before calling this. As of now (September 2005) all the server instances and asadmin VM itself has * this property set. The method does not guarantee that the script exists on the given system. It should * only be used when caller wants to know the location of the script. Caller should make sure it exists. * @return String representing the Path to asadmin script. Might return a string beginning with "null", if * the INSTALL_ROOT_PROPERTY is not defined */ public static final String getAsAdminScriptLocation() { return getAdminScriptLocation(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY)); }
public LocalAdminCommand(String command, String... args) { asadmin = new File(SystemPropertyConstants.getAsAdminScriptLocation()); cmds.add(asadmin.getAbsolutePath()); cmds.add(command); if (args != null && args.length > 0) cmds.addAll(Arrays.asList(args)); }
/** Returns the default value (as would appear in the domain.xml on installation) * of docroot of a virtual server, as a String. Never returns a null. * Returned String contains no backslashes. * Note that it is <b> not <b> the absolute value of the path on a file system. */ public static final String getDocRootDefaultValue() { final StringBuffer sb = new StringBuffer(getPropertyAsValue(INSTANCE_ROOT_PROPERTY)); return ( sb.append("/docroot").toString() ); }
/** Returns the string removing the "system-property syntax" from it. * If the given string is not in "system-property syntax" the same string is returned. * The "system-propery syntax" is "${...}" * The given String may not be null. * The returned String may be an empty String, if it is of the form "${}" (rarely so). */ public static final String unSystemProperty(final String sp) { if (sp == null) throw new IllegalArgumentException ("null_arg"); String ret = sp; if (isSystemPropertySyntax(sp)) { ret = sp.substring(2, sp.length() - 1); } return ( ret ); }
/** Returns the system specific file.separator delimited path to the asadmin script. Any changes to file layout should * be reflected here. The path will contain '/' as the separator character, regardless of operating * platform. Never returns a null. Assumes the the property "INSTALL_ROOT_PROPERTY" is set in the VM * before calling this. As of now (September 2005) all the server instances and asadmin VM itself has * this property set. The method does not guarantee that the script exists on the given system. It should * only be used when caller wants to know the location of the script. Caller should make sure it exists. * @return String representing the Path to asadmin script. Might return a string beginning with "null", if * the INSTALL_ROOT_PROPERTY is not defined */ public static final String getAsAdminScriptLocation() { return getAdminScriptLocation(System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY)); }
public LocalAdminCommand(String command, String... args) { asadmin = new File(SystemPropertyConstants.getAsAdminScriptLocation()); cmds.add(asadmin.getAbsolutePath()); cmds.add(command); if (args != null && args.length > 0) cmds.addAll(Arrays.asList(args)); }
/** Returns the default value (as would appear in the domain.xml on installation) * of file where the acess log of a virtual server is stored, as a String. Never returns a null. * Returned String contains no backslashes. * Note that it is <b> not <b> the absolute value of the path on a file system. */ public static final String getAccessLogDefaultValue() { final StringBuffer sb = new StringBuffer(getPropertyAsValue(INSTANCE_ROOT_PROPERTY)); return ( sb.append("/logs/access").toString() ); }
private void setAsadmin() { String s = SystemPropertyConstants.getAsAdminScriptLocation(); if (!StringUtils.ok(s)) throw new RuntimeException( Strings.get("internal.error", "Can't get Asadmin script location")); asadminScript = SmartFile.sanitize(new File(s)); if (!asadminScript.isFile()) { throw new RuntimeException( Strings.get("noAsadminScript", asadminScript)); } } // set at construction-time