Skip to content

Instantly share code, notes, and snippets.

@jonasermert
Created December 22, 2021 00:44
Show Gist options
  • Save jonasermert/c6b67b858ee5c06b5f6980f59cdd7b25 to your computer and use it in GitHub Desktop.
Save jonasermert/c6b67b858ee5c06b5f6980f59cdd7b25 to your computer and use it in GitHub Desktop.
import java.io.FileInputStream;
import java.util.Properties;
public class ReadPropertiesFile {
public static void main(String[] args) {
FileInputStream fis = new FileInputStream("Path to file");
Properties prop = new Properties();
prop.load(fis);
String uName = prop.getProperty("username");
String uPassword = prop.getProperty("password");
System.out.println(uName);
System.out.println(uPassword);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment