/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* Package private static utility methods
* @author bnevins
*/
public class GFLauncherUtils {
private GFLauncherUtils() {
// all static methods
}
}
}
return f != null && f.isDirectory();
}
// if it is already set as a System Property -- skip the huge block below
if(installDir == null)
{
return null;
}
return null;
}
try {
// important to sanitize it!
// unreported bug:
// JDK does this:
// the parent of "/foo/." is "/foo", not "/" !
f = f.getParentFile(); // <install>/modules
if (f == null) {
return null;
}
f = f.getParentFile(); // <install>/
if (f == null) {
return null;
}
}
catch (Exception e) {
installDir = null;
}
}
return installDir;
}
public static boolean isWindows() {
return false;
}
// case insensitive compare...
return true;
}
return false;
}
/**
* This method returns the fully qualified name of the host. If
* the name can't be resolved (on windows if there isn't a domain specified), just
* host name is returned
*
* @deprecated
* @return
* @throws UnknownHostException so it can be handled on a case by case basis
*/
return NetUtils.getCanonicalHostName();
}
return s;
}
if (index < 0) {
return s;
}
return ret;
}
/**
* Makes an educated guess on whether an arbitrary string is a relative path.
* If the string really is a path, it should be 100% accurate.
* If it is an arbitrary string like, say, "hello/./world", then it will say
* that it is a relative path.
* @param path the path to check
* @return true if the path is probably relative
*/
return false;
}
return true;
}
return true;
}
return true;
}
else {
return false;
}
}
/**
* Convert a classpath like string, e.g. c:/a;c:/b, and convert to List of File
* @param cp The classpath-like string
* @return the list of File
*/
{
}
return list;
}
boolean firstFile = true;
if(firstFile) {
firstFile = false;
}
else {
}
// let's use forward slashes for neatness...
}
}
private static void setInstallDirFromSystemProp() {
//
// For instance if we are called from an Embedded Server then InstallRoot
// may already be set as a System Prop -- and the jar we are running from has
// nothing whatever to do with the concept of an "install root".
// In that case we certainly do not want to wipe out the already set install root.
// if anything is not kosher simply return w/o setting installDir to anything.
if(!ok(installRootDirName))
return;
if(f.isDirectory()) {
installDir = f;
}
}
}