Package com.google.gerrit.pgm.init.api
Class InitUtil
- java.lang.Object
-
- com.google.gerrit.pgm.init.api.InitUtil
-
public class InitUtil extends Object
Utility functions to help initialize a site.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copy(Path dst, byte[] buf)
static Die
die(String why)
static Die
die(String why, Throwable cause)
static String
dnOf(String name)
static String
domainOf(String name)
static void
extract(Path dst, Class<?> sibling, String name)
static String
hostname()
static boolean
isAnyAddress(URI u)
static boolean
isLocal(String hostname)
static void
mkdir(File file)
static void
mkdir(Path path)
static int
portOf(URI uri)
static void
savePublic(org.eclipse.jgit.storage.file.FileBasedConfig sec)
static URI
toURI(String url)
static String
username()
static String
version()
-
-
-
Method Detail
-
savePublic
public static void savePublic(org.eclipse.jgit.storage.file.FileBasedConfig sec) throws IOException
- Throws:
IOException
-
mkdir
public static void mkdir(File file)
-
mkdir
public static void mkdir(Path path)
-
version
public static String version()
-
username
public static String username()
-
hostname
public static String hostname()
-
isLocal
public static boolean isLocal(String hostname)
-
extract
public static void extract(Path dst, Class<?> sibling, String name) throws IOException
- Throws:
IOException
-
copy
public static void copy(Path dst, byte[] buf) throws FileNotFoundException, IOException
- Throws:
FileNotFoundException
IOException
-
toURI
public static URI toURI(String url) throws URISyntaxException
- Throws:
URISyntaxException
-
isAnyAddress
public static boolean isAnyAddress(URI u)
-
portOf
public static int portOf(URI uri)
-
-