Système de synchronisation de l'information entre FileFrontEnd<>StorBackEnd -> implémentation de File

This commit is contained in:
Maximilien LEDOUX 2022-03-05 17:25:55 +01:00
parent 49fe7fb7e7
commit b2d34dbaf4

View File

@ -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<String> storage;
public File(String name, int size, String iv, Set<String> 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<String> getStorageIterator() {
return storage.iterator();
}
public boolean addStorage(String storage) {
if (this.storage.contains(storage)) {
return false;
} else {
this.storage.add(storage);
return true;
}
}
}