public HashMap<String, DataFile> createRepositoryData(
            String repositoryName, 
            String baseUrl, 
            List<String> repositoryUrls, 
            HashMap<String, byte[]> fileDatas)
            throws IOException, XmlException {

        String indexUrl = Utils.checkUrl(baseUrl + "/" + repositoryName + "/" + DataConstants.DEFAULT_INDEX_COMPRESSED_FILE_NAME);
        DataIndex dataIndex = new DataIndex(repositoryName, indexUrl, repositoryUrls);
        
        HashMap<String, DataFile> repositoryData = new HashMap<>();
        List<String> fileIds = new ArrayList<>();
        
        for (String filePath : fileDatas.keySet()) {
            if (!Utils.isDataFilePath(filePath)) {
                // Skip any files that aren't data files
                continue;
            }
            
            if (Utils.isCompressedPath(filePath)) {
                // We should only get uncompressed data at this point
                throw new IllegalArgumentException("Data file " + filePath + " is already compressed.");
            }
            
            byte[] fileData = fileDatas.get(filePath);
            ByteArrayInputStream inputStream = new ByteArrayInputStream(fileData);
            
            // Make sure we have just the filename, without the path
            String fileName = FilenameUtils.getName(filePath);
            
            DataFile dataFile;
            if (Utils.isGameSytstemPath(fileName)) {
                dataFile = readGameSystem(inputStream);
            }
            else if (Utils.isCataloguePath(fileName)) {
                dataFile = readCatalogue(inputStream);
            }
            else if (Utils.isRosterPath(fileName)) {
                dataFile = readRoster(inputStream);
            }
            else {
                continue;
            }
            
            if (fileIds.contains(dataFile.getId())) {
                continue; // Skip if we've already come accross this ID for this repo
            }
            fileIds.add(dataFile.getId());
            
            // Compress the file data and set it on the DataFile
            fileData = Utils.compressData(fileName, fileData);
            dataFile.setData(fileData);

            // Create a DataIndexEntry using compressed file name
            fileName = Utils.getCompressedFileName(fileName);
            DataIndexEntry dataIndexEntry = new DataIndexEntry(fileName, dataFile);
            
            // Add our data file and index entry
            repositoryData.put(fileName, dataFile);
            dataIndex.getDataIndexEntries().add(dataIndexEntry);
        }
        
        // Compress the index file data and set it on the DataIndex
        byte[] indexData = writeDataIndex(dataIndex);
        indexData = Utils.compressData(DataConstants.DEFAULT_INDEX_FILE_NAME, indexData);
        dataIndex.setData(indexData);
        
        // Add the DataIndex to the hashmap
        repositoryData.put(DataConstants.DEFAULT_INDEX_COMPRESSED_FILE_NAME, dataIndex);
        
        return repositoryData;
    }