Code example for FileNotFoundException

0
     *             If the specified properties file does not contain the 
     *             required keys. 
     */ 
    public PropertiesCredentials(File file) throws FileNotFoundException, IOException, IllegalArgumentException {
        if (!file.exists()) {
            throw new FileNotFoundException("File doesn't exist:  "
                                            + file.getAbsolutePath());
        } 
 
        FileInputStream stream = new FileInputStream(file);
        try { 
 
            Properties accountProperties = new Properties();
            accountProperties.load(stream);
 
            if (accountProperties.getProperty("accessKey") == null ||
                accountProperties.getProperty("secretKey") == null) {
                throw new IllegalArgumentException(
                    "The specified file (" + file.getAbsolutePath()
                    + ") doesn't contain the expected properties 'accessKey' "