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 voidcopy(Path dst, byte[] buf)static Diedie(String why)static Diedie(String why, Throwable cause)static StringdnOf(String name)static StringdomainOf(String name)static voidextract(Path dst, Class<?> sibling, String name)static Stringhostname()static booleanisAnyAddress(URI u)static booleanisLocal(String hostname)static voidmkdir(File file)static voidmkdir(Path path)static intportOf(URI uri)static voidsavePublic(org.eclipse.jgit.storage.file.FileBasedConfig sec)static URItoURI(String url)static Stringusername()static Stringversion()
-
-
-
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:
FileNotFoundExceptionIOException
-
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)
-
-