| | |
| | | { |
| | | private static final int BUFFER_SIZE = 1024; |
| | | |
| | | private static final int MAX_LINE_WIDTH = 80; |
| | | |
| | | private static final String[] OPEN_DS_JAR_RELATIVE_PATHS = |
| | | { "lib/quicksetup.jar", "lib/OpenDS.jar", "lib/je.jar" }; |
| | | |
| | |
| | | */ |
| | | public static String getInstallPathFromClasspath() |
| | | { |
| | | String installPath; |
| | | |
| | | /* Get the install path from the Class Path */ |
| | | String sep = System.getProperty("path.separator"); |
| | | String[] classPaths = System.getProperty("java.class.path").split(sep); |
| | |
| | | File f = new File(path).getAbsoluteFile(); |
| | | File binariesDir = f.getParentFile(); |
| | | |
| | | return binariesDir.getParent(); |
| | | /* |
| | | * Do a best effort to avoid having a relative representation (for |
| | | * instance to avoid having ../../../). |
| | | */ |
| | | try |
| | | { |
| | | installPath = binariesDir.getParentFile().getCanonicalPath(); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | | // Best effort |
| | | installPath = binariesDir.getParent(); |
| | | } |
| | | return installPath; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return (InitialLdapContext) pair[0]; |
| | | } |
| | | |
| | | /** |
| | | * Returns the max size in character of a line to be displayed in the command |
| | | * line. |
| | | * @return the max size in character of a line to be displayed in the command |
| | | * line. |
| | | */ |
| | | public static int getCommandLineMaxLineWidth() |
| | | { |
| | | return MAX_LINE_WIDTH; |
| | | } |
| | | } |