/** * Create a new feedbackstore with the specified storeId and fileNumber. * * @param storeId * the storeId * @param fileNumber * the new sequence number for this storeID * @return a feedbackstore */ private FeedbackStore createStore(long storeId, int fileNumber) throws IOException { File storeFile = new File(m_baseDir, getStoreName(storeId, fileNumber)); m_storeFileIdx.get(storeId).add(Integer.valueOf(fileNumber)); return new FeedbackStore(storeFile, storeId); }
/** * Create a new empty feedbackstore with a new storeId. * * @return A new feedbackstore with a new storeID */ private FeedbackStore newFeedbackStore() throws IOException { long storeId = System.currentTimeMillis(); String storeFilename; File storeFile; do { storeFilename = getStoreName(storeId, 1); storeFile = new File(m_baseDir, storeFilename); if (storeFile.createNewFile()) { break; } storeId++; } while (true); m_storeFileIdx.put(storeId, new TreeSet<>(Arrays.asList(1))); return new FeedbackStore(storeFile, storeId); }