Class ConverterUtil
- java.lang.Object
-
- jetbrains.buildServer.serverSide.versioning.converters.ConverterUtil
-
public final class ConverterUtil extends Object
- Author:
- Pavel.Sher Date: 18.10.2007
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROJECT_EXTENSION_PREFIX
-
Constructor Summary
Constructors Constructor Description ConverterUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.jdom.Element
createParamNode(String name, String value)
static void
createSchema(DBFunctions dbf, SchemaDef schemaDefinition)
Creates all tables and additional necessary objects of the given schema.static void
createTableIfNotExists(DBFunctions dbf, TableDef tableDefinition)
Creates the given table if such table doesn't exists.static void
dropTable(DBFunctions dbf, String tableName)
Drops a table with the specified name, if it exists.static void
dropTables(DBFunctions dbf, String... tableNames)
Drops tables with the specified names, if they exist.static void
error(String message)
static void
error(String message, Exception e)
static List<File>
findBuildTypeAndTemplateConfigs(File configDir)
static List<File>
findConfigs(File configDir, String configsDirName)
protected static long
findMaxFeatureId(File configDir)
static List<File>
findMetaRunners(File configDir)
static File[]
findProjectConfigs(File teamCityDataDir)
Finds all project-config.xml files under the data directory.static File[]
findProjectConfigsInProjectsDir(File projectsDir)
static File[]
findProjectDirs(File projectsDir)
static String
generateExternalIdByName(String name, String defaultPrefix, boolean requireFirstLetter, int limiLength)
static Map<String,String>
getBuildTemplateIntExtIdMap(DBFunctions dbf)
static Map<String,String>
getBuildTypeIntExtIdMap(DBFunctions dbf)
static List<org.jdom.Element>
getChildren(org.jdom.Element element, String name)
static File
getConfigDir(File teamCityDataDir)
static File
getProjectsDir(File teamCityDataDir)
static void
info(String message)
static boolean
isDebugEnabled()
static void
replaceInFile(String replace, String replacement, File file, String encoding)
Replaces strings in the provided file, writes new file content instead of old.static void
warn(String message)
-
-
-
Field Detail
-
PROJECT_EXTENSION_PREFIX
public static final String PROJECT_EXTENSION_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTableIfNotExists
public static void createTableIfNotExists(DBFunctions dbf, TableDef tableDefinition)
Creates the given table if such table doesn't exists.This method checks a table with the same name to exist, anmd if no - creates a table by the given definition. If a table with such name already exists, it does nothing. It doesn't compare the existent table with the given definition.
- Parameters:
dbf
- database session.tableDefinition
- table to create.
-
createSchema
public static void createSchema(DBFunctions dbf, SchemaDef schemaDefinition)
Creates all tables and additional necessary objects of the given schema.This method doesn't check for tables and constraints existence.
- Parameters:
dbf
- database session.schemaDefinition
- schema to create.
-
dropTables
public static void dropTables(@NotNull DBFunctions dbf, String... tableNames)
Drops tables with the specified names, if they exist.- Parameters:
dbf
- database session.tableName
- names of tables to drop.
-
dropTable
public static void dropTable(@NotNull DBFunctions dbf, @NotNull String tableName)
Drops a table with the specified name, if it exists.- Parameters:
dbf
- database session.tableName
- name of the table to drop.
-
findMaxFeatureId
protected static long findMaxFeatureId(File configDir)
-
replaceInFile
public static void replaceInFile(@NotNull String replace, @NotNull String replacement, @NotNull File file, @NotNull String encoding) throws IOException
Replaces strings in the provided file, writes new file content instead of old.- Parameters:
replace
- string to replacereplacement
- replacement stringfile
- file where to replace- Throws:
IOException
-
getChildren
@NotNull public static List<org.jdom.Element> getChildren(@NotNull org.jdom.Element element, @NotNull String name)
-
getBuildTemplateIntExtIdMap
@NotNull public static Map<String,String> getBuildTemplateIntExtIdMap(@NotNull DBFunctions dbf)
-
getBuildTypeIntExtIdMap
@NotNull public static Map<String,String> getBuildTypeIntExtIdMap(@NotNull DBFunctions dbf)
-
findBuildTypeAndTemplateConfigs
@NotNull public static List<File> findBuildTypeAndTemplateConfigs(@NotNull File configDir)
-
findConfigs
@NotNull public static List<File> findConfigs(@NotNull File configDir, @NotNull String configsDirName)
-
findProjectConfigs
@NotNull public static File[] findProjectConfigs(@NotNull File teamCityDataDir)
Finds all project-config.xml files under the data directory.- Parameters:
teamCityDataDir
-- Returns:
-
findProjectConfigsInProjectsDir
@NotNull public static File[] findProjectConfigsInProjectsDir(@NotNull File projectsDir)
-
generateExternalIdByName
@NotNull public static String generateExternalIdByName(@NotNull String name, @NotNull String defaultPrefix, boolean requireFirstLetter, int limiLength)
-
info
public static void info(@NotNull String message)
-
warn
public static void warn(@NotNull String message)
-
error
public static void error(@NotNull String message)
-
isDebugEnabled
public static boolean isDebugEnabled()
-
-