/** * Throughout the hierarchy, certain data elements are used to tag the * inclusion/exclusion/ordering of tasks within task lists. These data names contain task list * names and could contain task names, so they must be renamed. */ private boolean maybeRenameLocalTsElement(DataFileEntry e) { String dataName = e.getKey(); int[] tsPrefixPos = getTsPrefixPos(dataName); if (tsPrefixPos == null) return false; String path = dataName.substring(0, tsPrefixPos[0]); String tsPrefix = dataName.substring(tsPrefixPos[0], tsPrefixPos[1]); String taskListName = dataName.substring(tsPrefixPos[1]); String newName = pathMapper.getString(path) + tsPrefix + taskListMapper.hashTaskListName(taskListName); e.setKey(newName); return true; }
/** * The global.dat file contains data elements that hold metadata for locally defined task lists. * These data element names contain task list names and must be renamed. */ private boolean maybeRenameGlobalTSElement(DataFileEntry e) { // check to see if we are in the global data file if (!"global.dat".equals(e.getFilename())) return false; // look for the presence of the task & schedule dataname prefix String dataName = e.getKey(); if (!dataName.startsWith(GLOBAL_TS_PREFIX)) return false; // extract the task list name out of the data name int end = dataName.indexOf('/', beg + 1); if (end == -1) return false; String taskListName = dataName.substring(beg, end); // construct a new name for the data element String newName = taskListMapper.hashTaskListName(taskListName); e.setKey(GLOBAL_TS_PREFIX + newName + dataName.substring(end)); return true; }