From b2d34dbaf4eee549477fecf8d2b5be8efb9e8c7a Mon Sep 17 00:00:00 2001 From: Maximilien LEDOUX Date: Sat, 5 Mar 2022 17:25:55 +0100 Subject: [PATCH] =?UTF-8?q?Syst=C3=A8me=20de=20synchronisation=20de=20l'in?= =?UTF-8?q?formation=20entre=20FileFrontEnd<>StorBackEnd=20->=20impl=C3=A9?= =?UTF-8?q?mentation=20de=20File?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/lightcontainer/storage/File.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/src/main/java/lightcontainer/storage/File.java diff --git a/app/src/main/java/lightcontainer/storage/File.java b/app/src/main/java/lightcontainer/storage/File.java new file mode 100644 index 0000000..dcee5cc --- /dev/null +++ b/app/src/main/java/lightcontainer/storage/File.java @@ -0,0 +1,44 @@ +package lightcontainer.storage; + +import java.util.Iterator; +import java.util.Set; + +public class File { + + private final String name; + private final int size; + private final String iv; + private final Set storage; + + public File(String name, int size, String iv, Set storage) { + this.name = name; + this.size = size; + this.iv = iv; + this.storage = storage; + } + + public String getName() { + return name; + } + + public int getSize() { + return size; + } + + public String getIv() { + return iv; + } + + public Iterator getStorageIterator() { + return storage.iterator(); + } + + public boolean addStorage(String storage) { + if (this.storage.contains(storage)) { + return false; + } else { + this.storage.add(storage); + return true; + } + } +}