I have no idea what i have to do in save method. Smoeone can help?
package pl.codegym.task.task20.task2003;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/*
Wprowadzenie do properties
*/
public class Solution {
public static Map<String, String> properties = new HashMap<>();
public void fillInPropertiesMap() throws Exception {
// Implementuj tę metodę
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String fileName = reader.readLine();
reader.close();
FileInputStream inputStream = new FileInputStream(fileName);
load(inputStream);
String fileOut = "Lion.txt.part1";
FileOutputStream outputStream = new FileOutputStream(fileOut);
save(outputStream);
}
public void save(OutputStream outputStream) throws Exception {
// Implementuj tę metodę
PrintWriter writer = new PrintWriter(outputStream);
writer.println(properties);
writer.close();
}
public void load(InputStream inputStream) throws Exception {
// Implementuj tę metodę
Properties prop = new Properties();
prop.load(inputStream);
for(Map.Entry<Object, Object> para : prop.entrySet()){
String Key = String.valueOf(para.getKey());
String Value = String.valueOf(para.getValue());
properties.put(Key,Value);
}
inputStream.close();
}
public static void main(String[] args) throws Exception {
Solution sol = new Solution();
sol.fillInPropertiesMap();
}
}