modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/CertReader.java [56:97]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static Collection readCerts(String fileName, boolean readOnlyFirst,
            String providerName) throws CertificateException,
            NoSuchProviderException, IOException {

        InputStream input = getInputStream(fileName);
        CertificateFactory factory = getCertificateFactory(providerName);
        if (input == System.in){
            System.out.println("Please, input certificate(s)...");
        }
        try {
            // let the user paste the certificates or CRLs, if read from stdin.
            // If reading from file, don't sleep.
            Thread.sleep(sleepPeriod);
        } catch (InterruptedException e) {
            // do nothing
        }

        // if the file is empty or nothing was entered
        // FIXME: remove available. Try to read and catch exception?
        if (input.available() <= 0) {
            throw new IOException("Empty input");
        }

        Collection certCollection;
        try {
            // if only the first certificate is requested, return a
            // single-element Collection
            if (readOnlyFirst) {
                certCollection = Collections.singleton(factory
                        .generateCertificate(input));
            } else {
                certCollection = factory.generateCertificates(input);
            }
            if (input != System.in) {
                input.close();
            }
            return certCollection;
        } catch (CertificateException e) {
            throw new CertificateException(
                    "Failed to generate a certificate from the input. ", e);
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/CertReader.java [56:97]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static Collection readCerts(String fileName, boolean readOnlyFirst,
            String providerName) throws CertificateException,
            NoSuchProviderException, IOException {

        InputStream input = getInputStream(fileName);
        CertificateFactory factory = getCertificateFactory(providerName);
        if (input == System.in){
            System.out.println("Please, input certificate(s)...");
        }
        try {
            // let the user paste the certificates or CRLs, if read from stdin.
            // If reading from file, don't sleep.
            Thread.sleep(sleepPeriod);
        } catch (InterruptedException e) {
            // do nothing
        }

        // if the file is empty or nothing was entered
        // FIXME: remove available. Try to read and catch exception?
        if (input.available() <= 0) {
            throw new IOException("Empty input");
        }

        Collection certCollection;
        try {
            // if only the first certificate is requested, return a
            // single-element Collection
            if (readOnlyFirst) {
                certCollection = Collections.singleton(factory
                        .generateCertificate(input));
            } else {
                certCollection = factory.generateCertificates(input);
            }
            if (input != System.in) {
                input.close();
            }
            return certCollection;
        } catch (CertificateException e) {
            throw new CertificateException(
                    "Failed to generate a certificate from the input. ", e);
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



