congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PathUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
PathUtil
in
sockslib.utils

Best Java code snippets using sockslib.utils.PathUtil (Showing top 10 results out of 315)

origin: theotherp/nzbhydra2

public static JdbcConfiguration load(String filePath) {
  try {
    String realPath = PathUtil.getAbstractPath(filePath);
    logger.debug("Load file:{}", realPath);
    Properties properties = new Properties();
    properties.load(new FileInputStream(realPath));
    String url = properties.getProperty(URL_KEY);
    String username = properties.getProperty(USERNAME_KEY);
    String password = properties.getProperty(PASSWORD_KEY);
    return new JdbcConfiguration(url, username, password);
  } catch (IOException e) {
    logger.error(e.getMessage(), e);
  }
  return null;
}
origin: fengyouchao/sockslib

public static JdbcConfiguration load(String filePath) {
 try {
  String realPath = PathUtil.getAbstractPath(filePath);
  logger.debug("Load file:{}", realPath);
  Properties properties = new Properties();
  properties.load(new FileInputStream(realPath));
  String url = properties.getProperty(URL_KEY);
  String username = properties.getProperty(USERNAME_KEY);
  String password = properties.getProperty(PASSWORD_KEY);
  return new JdbcConfiguration(url, username, password);
 } catch (IOException e) {
  logger.error(e.getMessage(), e);
 }
 return null;
}
origin: theotherp/nzbhydra2

public static MongoDBConfiguration load(String filePath) {
  try {
    String realPath = PathUtil.getAbstractPath(filePath);
    logger.debug("Load file:{}", realPath);
    Properties properties = new Properties();
    properties.load(new FileInputStream(realPath));
    String host = properties.getProperty(HOST_KEY, DEFAULT_HOST);
    int port = Integer.parseInt(properties.getProperty(PORT_KEY, DEFAULT_PORT + ""));
    String database = properties.getProperty(DATABASE_KEY, DEFAULT_DATABASE);
    String username = properties.getProperty(USERNAME_KEY);
    String password = properties.getProperty(PASSWORD_KEY);
    return new MongoDBConfiguration(host, port, database, username, password);
  } catch (IOException e) {
    logger.error(e.getMessage(), e);
  }
  return null;
}
origin: fengyouchao/sockslib

public static MongoDBConfiguration load(String filePath) {
 try {
  String realPath = PathUtil.getAbstractPath(filePath);
  logger.debug("Load file:{}", realPath);
  Properties properties = new Properties();
  properties.load(new FileInputStream(realPath));
  String host = properties.getProperty(HOST_KEY, DEFAULT_HOST);
  int port = Integer.parseInt(properties.getProperty(PORT_KEY, DEFAULT_PORT + ""));
  String database = properties.getProperty(DATABASE_KEY, DEFAULT_DATABASE);
  String username = properties.getProperty(USERNAME_KEY);
  String password = properties.getProperty(PASSWORD_KEY);
  return new MongoDBConfiguration(host, port, database, username, password);
 } catch (IOException e) {
  logger.error(e.getMessage(), e);
 }
 return null;
}
origin: theotherp/nzbhydra2

public static SSLConfiguration load(String filePath) throws FileNotFoundException, IOException {
  checkNotNull(filePath, "Argument [filePath] may not be null");
  logger.debug("load SSL configuration file:{}", filePath);
  KeyStoreInfo keyStoreInfo = null;
  KeyStoreInfo trustKeyStoreInfo = null;
  Properties properties = new Properties();
  properties.load(new FileInputStream(filePath));
  String keystorePath = PathUtil.getAbstractPath(properties.getProperty("ssl.keystore.location"));
  String password = properties.getProperty("ssl.keystore.password");
  String type = properties.getProperty("ssl.keystore.type", "JSK");
  String trustKeystorePath =
      PathUtil.getAbstractPath(properties.getProperty("ssl.trustStore.location"));
  String trustPassword = properties.getProperty("ssl.trustStore.password");
  String trustType = properties.getProperty("ssl.trustStore.type", "JSK");
  if (!Strings.isNullOrEmpty(keystorePath)) {
    keyStoreInfo = new KeyStoreInfo(keystorePath, password, type);
  }
  if (!Strings.isNullOrEmpty(trustKeystorePath)) {
    trustKeyStoreInfo = new KeyStoreInfo(trustKeystorePath, trustPassword, trustType);
  }
  String clientAuthValue = properties.getProperty("ssl.client.auth", "false");
  boolean clientAuth = false;
  if (clientAuthValue.equalsIgnoreCase("true")) {
    clientAuth = true;
  }
  return new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo, clientAuth);
}
origin: fengyouchao/sockslib

public static SSLConfiguration load(String filePath) throws FileNotFoundException, IOException {
 checkNotNull(filePath, "Argument [filePath] may not be null");
 logger.debug("load SSL configuration file:{}", filePath);
 KeyStoreInfo keyStoreInfo = null;
 KeyStoreInfo trustKeyStoreInfo = null;
 Properties properties = new Properties();
 properties.load(new FileInputStream(filePath));
 String keystorePath = PathUtil.getAbstractPath(properties.getProperty("ssl.keystore.location"));
 String password = properties.getProperty("ssl.keystore.password");
 String type = properties.getProperty("ssl.keystore.type", "JSK");
 String trustKeystorePath =
   PathUtil.getAbstractPath(properties.getProperty("ssl.trustStore.location"));
 String trustPassword = properties.getProperty("ssl.trustStore.password");
 String trustType = properties.getProperty("ssl.trustStore.type", "JSK");
 if (!Strings.isNullOrEmpty(keystorePath)) {
  keyStoreInfo = new KeyStoreInfo(keystorePath, password, type);
 }
 if (!Strings.isNullOrEmpty(trustKeystorePath)) {
  trustKeyStoreInfo = new KeyStoreInfo(trustKeystorePath, trustPassword, trustType);
 }
 String clientAuthValue = properties.getProperty("ssl.client.auth", "false");
 boolean clientAuth = false;
 if (clientAuthValue.equalsIgnoreCase("true")) {
  clientAuth = true;
 }
 return new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo, clientAuth);
}
origin: fengyouchao/sockslib

public FileBasedUserManager(String storeFile, boolean autoReload, long reloadAfter) throws
  IOException {
 storeFile = PathUtil.getAbstractPath(storeFile);
 this.storeFile = new File(storeFile);
 this.autoReload = autoReload;
 this.reloadAfter = reloadAfter;
 loadFromFile();
 if (this.autoReload) {
  autoReloadService = new AutoReloadService(this.reloadAfter);
  autoReloadService.start();
 }
}
origin: theotherp/nzbhydra2

public FileBasedUserManager(String storeFile, boolean autoReload, long reloadAfter) throws
    IOException {
  storeFile = PathUtil.getAbstractPath(storeFile);
  this.storeFile = new File(storeFile);
  this.autoReload = autoReload;
  this.reloadAfter = reloadAfter;
  loadFromFile();
  if (this.autoReload) {
    autoReloadService = new AutoReloadService(this.reloadAfter);
    autoReloadService.start();
  }
}
origin: theotherp/nzbhydra2

username = values[2];
password = values[3];
trustKeyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[4]), values[5]);
configuration = new SSLConfiguration(null, trustKeyStoreInfo);
socks = new SSLSocks5(new InetSocketAddress(host, port), configuration);
username = values[2];
password = values[3];
trustKeyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[4]), values[5]);
keyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[6]), values[7]);
configuration = new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo);
socks = new SSLSocks5(new InetSocketAddress(host, port), configuration);
origin: fengyouchao/sockslib

username = values[2];
password = values[3];
trustKeyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[4]), values[5]);
configuration = new SSLConfiguration(null, trustKeyStoreInfo);
socks = new SSLSocks5(new InetSocketAddress(host, port), configuration);
username = values[2];
password = values[3];
trustKeyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[4]), values[5]);
keyStoreInfo = new KeyStoreInfo(PathUtil.getAbstractPath(values[6]), values[7]);
configuration = new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo);
socks = new SSLSocks5(new InetSocketAddress(host, port), configuration);
sockslib.utilsPathUtil

Javadoc

The class PathUtil represents a path utility.

Most used methods

  • getAbstractPath
    Returns abstract path.

Popular in Java

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now