public class FileHelper extends Object
| Constructor and Description |
|---|
FileHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildUri(String type,
String host,
String path,
String username,
String password,
Object sshKeyObj,
Map<String,Object> extraProperties)
Build uri string for
RouteBuilder to create route. |
static String |
getSshKey(boolean isSftp,
Object sshKeyObj)
Get ssh key, depending on protocol.
|
static boolean |
isNotNull(String s) |
static boolean |
isNull(String s) |
static String |
setExtraProperties(Map<String,Object> properties,
boolean firstOption)
Build uri string options.
|
static void |
stopIfRequiredPropertiesIsEmpty(String remotePath,
String type,
boolean isSftp,
String sshKey,
String password,
String username)
Check if required properties are set.
|
public static String buildUri(String type, String host, String path, String username, String password, Object sshKeyObj, Map<String,Object> extraProperties) throws IOException
RouteBuilder to create route.type - type of File trigger (file/sftp/ftp)host - remote host\ippath - remote pathusername - usernamepassword - password can be empty if using ssh keyextraProperties - additional properties which user configures on UIIOException - if creating temp file for ssh key is failedpublic static boolean isNull(String s)
public static boolean isNotNull(String s)
public static String setExtraProperties(Map<String,Object> properties, boolean firstOption)
properties - - extra endpoint properties from transports configsfirstOption - - if true '?' will be added to uri string before first uri option, else '&'public static String getSshKey(boolean isSftp, Object sshKeyObj)
isSftp - - true for sftp transport, false otherwisesshKeyObj - - ssh key valuepublic static void stopIfRequiredPropertiesIsEmpty(String remotePath, String type, boolean isSftp, String sshKey, String password, String username)
remotePath - remote pathtype - transport typeisSftp - true for sftp, false otherwisesshKey - ssh key valuepassword - passwordusername - user nameCopyright © 2025. All rights reserved.