org.apache.directory.studio.apacheds
Class ApacheDsPluginUtils

java.lang.Object
  extended by org.apache.directory.studio.apacheds.ApacheDsPluginUtils

public class ApacheDsPluginUtils
extends java.lang.Object

This class contains helpful methods.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
static java.lang.String LINE_SEPARATOR
          The line separator
 
Constructor Summary
ApacheDsPluginUtils()
           
 
Method Summary
static void createNewServerFolder(java.lang.String id)
          Creates a new server folder for the given id.
static void createServersLog4jPropertiesFile(java.io.OutputStream os, int port, java.lang.String logsLevel, java.lang.String logsPattern)
          Create the log4j.properties file for the server.
static java.lang.String[] getApacheDsLibraries(Server server)
          Gets an array containing the names of the Apache DS libraries, according to the given server.
static org.eclipse.core.runtime.IPath getApacheDsLibrariesFolder(Server server)
          Get the path to the Apache DS libraries folder.
static org.eclipse.core.runtime.IPath getApacheDsServersFolder()
          Get the path to the Apache DS servers folder.
static ServerConfiguration getServerConfiguration(Server server)
          Gets the server configuration.
static java.lang.String getServerLogsLevel()
          Gets the server logs level.
static java.lang.String getServerLogsPattern()
          Gets the server logs pattern.
static void reportError(java.lang.String message)
          Reports an error.
static void verifyLibrariesFolder(Server server)
          Verifies that the libraries folder exists and contains the jar files needed to launch the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final java.lang.String LINE_SEPARATOR
The line separator

Constructor Detail

ApacheDsPluginUtils

public ApacheDsPluginUtils()
Method Detail

verifyLibrariesFolder

public static void verifyLibrariesFolder(Server server)
Verifies that the libraries folder exists and contains the jar files needed to launch the server.

Parameters:
server - the server

getApacheDsLibraries

public static java.lang.String[] getApacheDsLibraries(Server server)
Gets an array containing the names of the Apache DS libraries, according to the given server.

Parameters:
server - the server
Returns:
an array containing the names of the Apache DS libraries, according to the given server

getApacheDsLibrariesFolder

public static org.eclipse.core.runtime.IPath getApacheDsLibrariesFolder(Server server)
Get the path to the Apache DS libraries folder.

Parameters:
server - the server
Returns:
the path to the Apache DS libraries folder

getApacheDsServersFolder

public static org.eclipse.core.runtime.IPath getApacheDsServersFolder()
Get the path to the Apache DS servers folder.

Returns:
the path to the Apache DS server folder

createNewServerFolder

public static void createNewServerFolder(java.lang.String id)
Creates a new server folder for the given id.

Parameters:
id - the id of the server

createServersLog4jPropertiesFile

public static void createServersLog4jPropertiesFile(java.io.OutputStream os,
                                                    int port,
                                                    java.lang.String logsLevel,
                                                    java.lang.String logsPattern)
                                             throws java.io.IOException
Create the log4j.properties file for the server.

Parameters:
os - the OutputStream to write to
port - the port
logsLevel - the logs level
logsLevel - the logs pattern
Throws:
java.io.IOException - if an error occurs when writing to the file

getServerLogsLevel

public static java.lang.String getServerLogsLevel()
Gets the server logs level.

Returns:
the server logs level

getServerLogsPattern

public static java.lang.String getServerLogsPattern()
Gets the server logs pattern.

Returns:
the server logs pattern

reportError

public static void reportError(java.lang.String message)
Reports an error.

Parameters:
message - the message

getServerConfiguration

public static ServerConfiguration getServerConfiguration(Server server)
                                                  throws ServerXmlIOException,
                                                         java.io.IOException
Gets the server configuration.

Parameters:
server - the server
Returns:
the associated server configuration
Throws:
ServerXmlIOException
ServerXmlIOException
java.io.IOException


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.