-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSavedFile.java
More file actions
38 lines (30 loc) · 837 Bytes
/
SavedFile.java
File metadata and controls
38 lines (30 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.io.Serializable;
import java.util.ArrayList;
public class SavedFile implements Serializable {
private String filename;
private boolean seeder;
private ArrayList<String> pieces;
public SavedFile(String filename, boolean seeder) {
this.filename = filename;
this.seeder = seeder;
this.pieces = new ArrayList<>();
}
public String getFilename() {
return filename;
}
public boolean getSeeder() {
return seeder;
}
public void setSeeder(boolean seeder) {
this.seeder = seeder;
}
public ArrayList<String> getPieces() {
return new ArrayList<>(pieces);
}
public void setPieces(ArrayList<String> pieces) {
this.pieces = pieces;
}
public void addPiece(String piece) {
pieces.add(piece);
}
}