aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/pinapelz/FileSystem.java
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-12-26 21:48:57 -0800
committerPinapelz <yukais@pinapelz.com>2025-12-26 21:48:57 -0800
commita0414925cdf6d57acc8d2f0f0646e495707bd632 (patch)
tree9d08efd4d6d0b300b8fda433ddbc1c5025f3b58a /src/main/java/com/pinapelz/FileSystem.java
initial commit
Diffstat (limited to 'src/main/java/com/pinapelz/FileSystem.java')
-rw-r--r--src/main/java/com/pinapelz/FileSystem.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/com/pinapelz/FileSystem.java b/src/main/java/com/pinapelz/FileSystem.java
new file mode 100644
index 0000000..61b1bd6
--- /dev/null
+++ b/src/main/java/com/pinapelz/FileSystem.java
@@ -0,0 +1,23 @@
+package com.pinapelz;
+
+import net.dv8tion.jda.api.entities.Message;
+
+import java.sql.SQLException;
+
+public class FileSystem {
+ private Database database;
+ public FileSystem(String dbHost, String dbUser, String dbPass, String dbName){
+ database = new Database(dbHost, dbUser, dbPass, dbName);
+ }
+
+ public void createNewFile(String messageId, String channelId, String description, Message.Attachment attachment){
+ int fileSize = attachment.getSize();
+ String filename = attachment.getFileName();
+ String mimeType = attachment.getContentType();
+ try {
+ database.recordFileMetadata(channelId, messageId, 1, filename, description, fileSize, mimeType );
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage