}
protected synchronized FileSegment getNewSegment() {
int newIndex = getFileSegmentsCount();
FileSegmentDAO fileSegmentDAO = new FileSegmentDAO();
return fileSegmentDAO.create(getFile(), new Long(newIndex), null);
}
private synchronized File getFile() {
FileDAO fileDAO = new FileDAO();
File file = fileDAO.findByDirectoryAndName(directory.getDirectory(), fileName);