-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFile.py
37 lines (27 loc) · 772 Bytes
/
File.py
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
'''
Created on Jan 9, 2015
@author: niuzhaojie
'''
import Configuration
from FileBlock import FileBlock
from BlockType import BlockType
class File(object):
'''
classdocs
'''
def __init__(self, fileName, size):
'''
Constructor
'''
self._fileName = fileName
self._size = size
self._blockList = []
blockNum = self._size / Configuration.BLOCK_SIZE
for i in range(blockNum):
self._blockList.append(FileBlock(fileName + str(i), Configuration.BLOCK_SIZE, BlockType.PERMANENT))
def getFileName(self):
return self._fileName
def getFileSize(self):
return self._size
def getBlockList(self):
return self._blockList