mirror of
https://github.com/Akomry/sae302_applicom.git
synced 2025-12-06 11:43:53 +00:00
fix(resources): tweaks sur les resources du projet, fonctionne désormais sur la version compilée de l'app
This commit is contained in:
parent
d11df74578
commit
d4e6f47c52
8 changed files with 20 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ module rtgre.chat {
|
|||
requires net.synedra.validatorfx;
|
||||
requires org.json;
|
||||
requires java.sql;
|
||||
requires org.xerial.sqlitejdbc;
|
||||
|
||||
|
||||
opens rtgre.chat to javafx.fxml;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ public class ChatLauncher {
|
|||
ChatApplication.main(args);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
e.printStackTrace();
|
||||
System.out.println("test2");
|
||||
ChatApplication.main(args);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class ChatApplication extends Application {
|
|||
InputStream is = ChatApplication.class
|
||||
.getResource("logging.properties").openStream();
|
||||
LogManager.getLogManager().readConfiguration(is);
|
||||
if (!Files.exists(new File("chat/target/").toPath())) {
|
||||
if (!Files.exists(new File("target/").toPath())) {
|
||||
Files.createDirectory(new File("target").toPath());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ public class ChatController implements Initializable {
|
|||
|
||||
try {
|
||||
InputStream in = ChatController.class.getResourceAsStream("config.properties");
|
||||
System.out.println(ChatController.class.getResource("config.properties").getPath());
|
||||
properties.load(in);
|
||||
if (contact != null) {
|
||||
this.contact.setAvatar(Contact.base64ToImage(properties.getProperty("avatar")));
|
||||
|
|
@ -241,6 +242,7 @@ public class ChatController implements Initializable {
|
|||
}
|
||||
properties.setProperty("avatar", Contact.imageToBase64(ImageIO.read(selectedFile)));
|
||||
properties.store(new FileOutputStream(getClass().getResource("config.properties").getPath()), null);
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOGGER.warning("Impossible de lire l'image!");
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import javax.xml.transform.Result;
|
|||
import java.io.File;
|
||||
import java.sql.*;
|
||||
import java.util.UUID;
|
||||
import org.sqlite.JDBC;
|
||||
|
||||
import static rtgre.chat.ChatApplication.LOGGER;
|
||||
|
||||
|
|
@ -13,7 +14,7 @@ public class DatabaseApi {
|
|||
|
||||
public DatabaseApi() {
|
||||
try {
|
||||
this.con = DriverManager.getConnection("jdbc:sqlite:chat/src/main/resources/rtgre/chat/dbase.db");
|
||||
this.con = DriverManager.getConnection("jdbc:sqlite:target/dbase.db");
|
||||
this.stmt = con.createStatement();
|
||||
initDB(con);
|
||||
LOGGER.info("Database connected!");
|
||||
|
|
|
|||
|
|
@ -41,6 +41,11 @@ public class ChatServer {
|
|||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
try {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
ChatServer server = new ChatServer(2024);
|
||||
//daisyConnect();
|
||||
server.acceptClients();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue