org.xipki.util.IoUtil.expandFilepath()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.xipki.util.IoUtil.expandFilepath()方法的一些代码示例,展示了IoUtil.expandFilepath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IoUtil.expandFilepath()方法的具体详情如下:
包路径:org.xipki.util.IoUtil
类名称:IoUtil
方法名:expandFilepath

IoUtil.expandFilepath介绍

暂无

代码示例

代码示例来源:origin: org.xipki/ca-mgmt-client

public ImportOcspFromCaDb(DataSourceFactory datasourceFactory,
  PasswordResolver passwordResolver, String dbConfFile, String publisherName,
  boolean resume, String srcFolder, int batchEntriesPerCommit, boolean evaluateOnly)
  throws PasswordResolverException, IOException {
 super(datasourceFactory, passwordResolver, dbConfFile);
 this.publisherName = publisherName;
 this.resume = resume;
 this.srcFolder = IoUtil.expandFilepath(srcFolder);
 this.batchEntriesPerCommit = batchEntriesPerCommit;
}

代码示例来源:origin: xipki/xipki

public static byte[] read(String fileName) throws IOException {
 return Files.readAllBytes(
   Paths.get(
     expandFilepath(fileName)));
}

代码示例来源:origin: org.xipki/util

public static byte[] read(String fileName) throws IOException {
 return Files.readAllBytes(
   Paths.get(
     expandFilepath(fileName)));
}

代码示例来源:origin: org.xipki/util

public static byte[] read(File file) throws IOException {
 return Files.readAllBytes(
   Paths.get(
     expandFilepath(file.getPath())));
}

代码示例来源:origin: xipki/xipki

public static byte[] read(File file) throws IOException {
 return Files.readAllBytes(
   Paths.get(
     expandFilepath(file.getPath())));
}

代码示例来源:origin: xipki/xipki

public static File expandFilepath(File file) {
 String path = file.getPath();
 String expandedPath = expandFilepath(path);
 return path.equals(expandedPath) ? file : new File(expandedPath);
}

代码示例来源:origin: org.xipki/util

public static File expandFilepath(File file) {
 String path = file.getPath();
 String expandedPath = expandFilepath(path);
 return path.equals(expandedPath) ? file : new File(expandedPath);
}

代码示例来源:origin: org.xipki/util

public static void save(File file, byte[] content) throws IOException {
 File tmpFile = expandFilepath(file);
 mkdirsParent(tmpFile.toPath());
 Files.copy(new ByteArrayInputStream(content), tmpFile.toPath(),
   StandardCopyOption.REPLACE_EXISTING);
}

代码示例来源:origin: org.xipki/security-pkcs11

public void setPkcs11ConfFile(String confFile) {
 if (StringUtil.isBlank(confFile)) {
  this.pkcs11ConfFile = null;
 } else {
  this.pkcs11ConfFile = IoUtil.expandFilepath(confFile);
 }
}

代码示例来源:origin: xipki/xipki

public static void save(File file, byte[] content) throws IOException {
 File tmpFile = expandFilepath(file);
 mkdirsParent(tmpFile.toPath());
 Files.copy(new ByteArrayInputStream(content), tmpFile.toPath(),
   StandardCopyOption.REPLACE_EXISTING);
}

代码示例来源:origin: org.xipki/ca-server

public void setConfFile(String confFile) {
 Args.notBlank(confFile, "confFile");
 Properties confProps = new Properties();
 try {
  confProps.load(Files.newInputStream(Paths.get(IoUtil.expandFilepath(confFile))));
 } catch (IOException ex) {
  throw new IllegalArgumentException("could not parse CA configuration file " + confFile, ex);
 }
 this.confProperties = confProps;
}

代码示例来源:origin: org.xipki/ca-mgmt-client

public ExportCaDb(DataSourceFactory datasourceFactory, PasswordResolver passwordResolver,
  String dbConfFile, String destFolder, boolean resume, int numCertsInBundle,
  int numCertsPerSelect) throws PasswordResolverException, IOException {
 super(datasourceFactory, passwordResolver, dbConfFile);
 this.destFolder = IoUtil.expandFilepath(destFolder);
 this.resume = resume;
 this.numCertsInBundle = numCertsInBundle;
 this.numCertsPerSelect = numCertsPerSelect;
 checkDestFolder();
}

代码示例来源:origin: org.xipki/security

public void setPkcs11ConfFile(String confFile) {
 if (StringUtil.isBlank(confFile)) {
  this.pkcs11ConfFile = null;
 } else {
  this.pkcs11ConfFile = IoUtil.expandFilepath(confFile);
 }
}

代码示例来源:origin: org.xipki/security

public static X509Certificate parseCert(File file) throws IOException, CertificateException {
 Args.notNull(file, "file");
 InputStream in = Files.newInputStream(IoUtil.expandFilepath(file).toPath());
 try {
  return parseCert(in);
 } finally {
  in.close();
 }
}

代码示例来源:origin: org.xipki/security

public static CertificationRequest parseCsr(File file) throws IOException {
 Args.notNull(file, "file");
 InputStream in = Files.newInputStream(IoUtil.expandFilepath(file).toPath());
 try {
  return parseCsr(in);
 } finally {
  in.close();
 }
}

代码示例来源:origin: org.xipki/security

public static org.bouncycastle.asn1.x509.Certificate parseBcCert(File file)
  throws IOException, CertificateException {
 Args.notNull(file, "file");
 InputStream in = Files.newInputStream(IoUtil.expandFilepath(file).toPath());
 try {
  return parseBcCert(in);
 } finally {
  in.close();
 }
}

代码示例来源:origin: org.xipki/security

public static X509CRL parseCrl(File file)
  throws IOException, CertificateException, CRLException {
 Args.notNull(file, "file");
 return parseCrl(Files.newInputStream(IoUtil.expandFilepath(file).toPath()));
}

代码示例来源:origin: org.xipki/ca-api

public CaConf(File confFile, SecurityFactory securityFactory)
  throws IOException, InvalidConfException, CaMgmtException {
 Args.notNull(securityFactory, "securityFactory");
 confFile = IoUtil.expandFilepath(Args.notNull(confFile, "confFile"));
 init(Files.newInputStream(confFile.toPath()), securityFactory);
}

代码示例来源:origin: org.xipki/ca-dbtool

public DbToolBase(DataSourceWrapper datasource, String baseDir, AtomicBoolean stopMe)
  throws DataAccessException {
 ParamUtil.requireNonBlank("baseDir", baseDir);
 this.stopMe = ParamUtil.requireNonNull("stopMe", stopMe);
 this.datasource = ParamUtil.requireNonNull("datasource", datasource);
 this.connection = datasource.getConnection();
 try {
  this.connectionAutoCommit = connection.getAutoCommit();
 } catch (SQLException ex) {
  throw datasource.translate(null, ex);
 }
 this.baseDir = IoUtil.expandFilepath(baseDir);
}

代码示例来源:origin: xipki/xipki

@Override
public void init(String conf) throws PasswordResolverException {
 Args.notBlank(conf, "conf");
 ConfPairs pairs = new ConfPairs(conf);
 passwordFile = pairs.value("file");
 if (StringUtil.isBlank(passwordFile)) {
  throw new PasswordResolverException("invalid configuration " + conf
    + ", no file is specified");
 }
 passwordFile = IoUtil.expandFilepath(passwordFile);
}

相关文章