Made code review.
This commit is contained in:
parent
e22c563554
commit
c38e987611
@ -83,7 +83,7 @@ public class Application implements ReviewListener
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final File file = new File(date + "_" + this.properties.getProperty(FILE_SUFFIX));
|
File file = new File(date + "_" + this.properties.getProperty(FILE_SUFFIX));
|
||||||
FileUtils.writeStringToFile(file, text);
|
FileUtils.writeStringToFile(file, text);
|
||||||
this.bot.sendMessage("% Compte-rendu de la revue : " + file.getName());
|
this.bot.sendMessage("% Compte-rendu de la revue : " + file.getName());
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class PastebinClient
|
|||||||
public static final String API_ERROR = "Bad API request,";
|
public static final String API_ERROR = "Bad API request,";
|
||||||
|
|
||||||
private final String apiKey;
|
private final String apiKey;
|
||||||
private String apiUserKey = null;
|
private String apiUserKey;
|
||||||
|
|
||||||
private HttpClient httpClient = new DefaultHttpClient();
|
private HttpClient httpClient = new DefaultHttpClient();
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public class CollectiveTopic extends Topic
|
public class CollectiveTopic extends Topic
|
||||||
{
|
{
|
||||||
private final Messages messages = new Messages();
|
private final Messages messages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new collective topic.
|
* Instantiates a new collective topic.
|
||||||
@ -39,6 +39,8 @@ public class CollectiveTopic extends Topic
|
|||||||
public CollectiveTopic(final String title)
|
public CollectiveTopic(final String title)
|
||||||
{
|
{
|
||||||
super(title);
|
super(title);
|
||||||
|
|
||||||
|
this.messages = new Messages();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -28,7 +28,7 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public class IndividualTopic extends Topic
|
public class IndividualTopic extends Topic
|
||||||
{
|
{
|
||||||
private final Map<String, Messages> messages = new HashMap<String, Messages>();
|
private final Map<String, Messages> messages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new individual topic.
|
* Instantiates a new individual topic.
|
||||||
@ -39,6 +39,8 @@ public class IndividualTopic extends Topic
|
|||||||
public IndividualTopic(final String title)
|
public IndividualTopic(final String title)
|
||||||
{
|
{
|
||||||
super(title);
|
super(title);
|
||||||
|
|
||||||
|
this.messages = new HashMap<String, Messages>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -26,7 +26,7 @@ import org.joda.time.DateTime;
|
|||||||
*/
|
*/
|
||||||
public class Message
|
public class Message
|
||||||
{
|
{
|
||||||
private final DateTime date = new DateTime();
|
private final DateTime date;
|
||||||
private final String author;
|
private final String author;
|
||||||
private final String content;
|
private final String content;
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ public class Message
|
|||||||
{
|
{
|
||||||
this.author = author;
|
this.author = author;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
|
this.date = new DateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,11 +51,11 @@ public class UserAlias
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final Unmarshaller u = JAXBContext.newInstance(Users.class).createUnmarshaller();
|
final Unmarshaller unmarshaller = JAXBContext.newInstance(Users.class).createUnmarshaller();
|
||||||
u.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
|
unmarshaller.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
|
||||||
.newSchema(UserAlias.class.getResource("/fr/imirhil/april/hebdobot/users.xsd")));
|
.newSchema(UserAlias.class.getResource("/fr/imirhil/april/hebdobot/users.xsd")));
|
||||||
|
|
||||||
for (final User user : u.unmarshal(new StreamSource(source), Users.class).getValue().getUser())
|
for (final User user : unmarshaller.unmarshal(new StreamSource(source), Users.class).getValue().getUser())
|
||||||
{
|
{
|
||||||
final String realName = user.getRealName();
|
final String realName = user.getRealName();
|
||||||
for (final String nick : user.getNick())
|
for (final String nick : user.getNick())
|
||||||
|
Loading…
Reference in New Issue
Block a user