diff --git a/src/main/java/life/qbic/qpostman/download/WriteFileToDisk.java b/src/main/java/life/qbic/qpostman/download/WriteFileToDisk.java index 0e8deda..ca89b51 100644 --- a/src/main/java/life/qbic/qpostman/download/WriteFileToDisk.java +++ b/src/main/java/life/qbic/qpostman/download/WriteFileToDisk.java @@ -41,9 +41,8 @@ public WriteFileToDisk(IDataStoreServerApi dataStoreServerApi, int bufferSize, P } private static Path toOutputPath(DataFile dataFile, Path outputDirectory) { - String originalFilePath = dataFile.filePath(); - Path outFilePath = outputDirectory.resolve(originalFilePath); - return outFilePath; + Path dataSetDirectory = outputDirectory.resolve(dataFile.dataSet().sampleCode()); + return dataSetDirectory.resolve(dataFile.filePath()); } private AutoClosableDataSetFileDownloadReader toReader(DataFile dataFile) {