I think I made a change. Commiting and pushing just in case.
This commit is contained in:
parent
e5504ca6e7
commit
d5dc842cd0
3 changed files with 10 additions and 5 deletions
|
@ -95,13 +95,12 @@ public class Chat {
|
||||||
lines = new ArrayList<String>();
|
lines = new ArrayList<String>();
|
||||||
|
|
||||||
Map.Entry<String, ArrayList<ChatListItem>> entry = (Map.Entry<String, ArrayList<ChatListItem>>) it.next();
|
Map.Entry<String, ArrayList<ChatListItem>> entry = (Map.Entry<String, ArrayList<ChatListItem>>) it.next();
|
||||||
lines.add("#List name:");
|
lines.add(entry.getKey());
|
||||||
lines.add("#" + entry.getKey());
|
|
||||||
|
|
||||||
if(name != null) {
|
if(name != null) {
|
||||||
lines.add("#Chat name:");
|
lines.add("#Chat name: " + name);
|
||||||
lines.add("#" + name);
|
|
||||||
}
|
}
|
||||||
|
lines.add("#List name: " + entry.getKey());
|
||||||
|
|
||||||
ArrayList<ChatListItem> list = entry.getValue();
|
ArrayList<ChatListItem> list = entry.getValue();
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,8 @@ public class Persistence {
|
||||||
|
|
||||||
for(int i = 0; i < lists.size(); i++) {
|
for(int i = 0; i < lists.size(); i++) {
|
||||||
List<String> lines = lists.get(i);
|
List<String> lines = lists.get(i);
|
||||||
String filename = lines.get(1).substring("#".length());
|
String filename = lines.get(1);
|
||||||
|
lines.remove(1);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
file = Paths.get("geiserFiles/" + c.getChatId() + "/lists/" + filename + ".txt");
|
file = Paths.get("geiserFiles/" + c.getChatId() + "/lists/" + filename + ".txt");
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
import com.mashape.unirest.http.exceptions.UnirestException;
|
import com.mashape.unirest.http.exceptions.UnirestException;
|
||||||
|
import elements.exceptions.ReadErrorChatException;
|
||||||
|
import elements.exceptions.ReadErrorListException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Guillermo Serrahima on 4/1/16.
|
* Created by Guillermo Serrahima on 4/1/16.
|
||||||
|
@ -16,6 +18,9 @@ public class Main {
|
||||||
} catch (UnirestException e) {
|
} catch (UnirestException e) {
|
||||||
System.out.println("Unirest Error catched.");
|
System.out.println("Unirest Error catched.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (ReadErrorChatException | ReadErrorListException e) {
|
||||||
|
System.out.println("Read Error catched.");
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue