public class IngestExampleHelper extends Object
Constructor and Description |
---|
IngestExampleHelper() |
Modifier and Type | Method and Description |
---|---|
static Path |
createTempCsv(String directoryPath,
String filename,
int rows) |
static void |
doQuery(Connection conn,
String query)
Try to execute a SQL query and throw if it fails
|
static KeyPair |
generateKeyPair()
Generates an RSA keypair for use in this test
|
static Connection |
getConnection(String user,
String password,
String account,
String host,
int port) |
static String |
getPublicKeyString(KeyPair keypair)
Generate the public key as a string
|
static void |
makeLocalDirectory(String directoryPath)
Create directories if they don't exist under directoryPath.
|
static void |
makeSampleFile(String directoryPath,
String filename)
Create file under directoryPath with fileName and populate it with test data
|
public static void makeLocalDirectory(String directoryPath) throws IOException
directoryPath
- IOException
public static Path createTempCsv(String directoryPath, String filename, int rows) throws IOException
IOException
public static void makeSampleFile(String directoryPath, String filename) throws IOException
directoryPath
- filename
- IOException
public static Connection getConnection(String user, String password, String account, String host, int port) throws Exception
Exception
public static void doQuery(Connection conn, String query)
query
- the query in questionpublic static KeyPair generateKeyPair() throws NoSuchProviderException, NoSuchAlgorithmException
NoSuchAlgorithmException
- if we don't have an RSA algoNoSuchProviderException
- if we can't use SHA1PRNG for randomizationpublic static String getPublicKeyString(KeyPair keypair) throws NoSuchAlgorithmException, InvalidKeySpecException
NoSuchAlgorithmException
InvalidKeySpecException
Copyright © 2023. All rights reserved.