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; }
public static byte[] read(String fileName) throws IOException { return Files.readAllBytes( Paths.get( expandFilepath(fileName))); }
public static byte[] read(String fileName) throws IOException { return Files.readAllBytes( Paths.get( expandFilepath(fileName))); }
public static byte[] read(File file) throws IOException { return Files.readAllBytes( Paths.get( expandFilepath(file.getPath()))); }
public static byte[] read(File file) throws IOException { return Files.readAllBytes( Paths.get( expandFilepath(file.getPath()))); }
public static File expandFilepath(File file) { String path = file.getPath(); String expandedPath = expandFilepath(path); return path.equals(expandedPath) ? file : new File(expandedPath); }
public static File expandFilepath(File file) { String path = file.getPath(); String expandedPath = expandFilepath(path); return path.equals(expandedPath) ? file : new File(expandedPath); }
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); }
public void setPkcs11ConfFile(String confFile) { if (StringUtil.isBlank(confFile)) { this.pkcs11ConfFile = null; } else { this.pkcs11ConfFile = IoUtil.expandFilepath(confFile); } }
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); }
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; }
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(); }
public void setPkcs11ConfFile(String confFile) { if (StringUtil.isBlank(confFile)) { this.pkcs11ConfFile = null; } else { this.pkcs11ConfFile = IoUtil.expandFilepath(confFile); } }
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(); } }
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(); } }
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(); } }
public static X509CRL parseCrl(File file) throws IOException, CertificateException, CRLException { Args.notNull(file, "file"); return parseCrl(Files.newInputStream(IoUtil.expandFilepath(file).toPath())); }
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); }
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); }
@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); }