root / DeleteFile.java @ 1
History | View | Annotate | Download (849 Bytes)
1 |
import java.io.File; |
---|---|
2 |
import java.util.ArrayList; |
3 |
|
4 |
/**
|
5 |
* DeleteFile
|
6 |
*/
|
7 |
public class DeleteFile { |
8 |
private File file; |
9 |
private String fileId; |
10 |
private ArrayList<byte[]> chunks = new ArrayList<>(); |
11 |
|
12 |
public DeleteFile(String fileId) { |
13 |
this.fileId = fileId;
|
14 |
} |
15 |
|
16 |
public DeleteFile(String path, String fileId) { |
17 |
this.fileId = fileId;
|
18 |
this.file = new File(path); |
19 |
} |
20 |
|
21 |
/**
|
22 |
* @return the chunks
|
23 |
*/
|
24 |
public ArrayList<byte[]> getChunks() { |
25 |
return chunks;
|
26 |
} |
27 |
|
28 |
/**
|
29 |
* @return the fileId
|
30 |
*/
|
31 |
public String getFileId() { |
32 |
return fileId;
|
33 |
} |
34 |
|
35 |
public File getFile() { |
36 |
return this.file; |
37 |
} |
38 |
|
39 |
public boolean hasChunk(int i) { |
40 |
try {
|
41 |
this.chunks.get(i);
|
42 |
} catch (Exception e) { |
43 |
return false; |
44 |
} |
45 |
return true; |
46 |
} |
47 |
} |