mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-24 00:09:07 +01:00
Use repository specific work dirs (#1510)
With this change, work dirs are created in the directory of the repository and no longer in the global scm work dir directory. This is relevant due to two facts: 1. Repositories may contain confidential data and therefore reside in special directories (that may be mounted on special drives). It may be considered a breach when these directories are cloned or otherwise copied to global temporary drives. 2. Big repositories may overload global temp spaces. It may be easier to create special drives with more space for such big repositories.
This commit is contained in:
@@ -107,7 +107,7 @@ public class FullScmRepositoryExporter {
|
||||
}
|
||||
|
||||
private void writeRepository(RepositoryService service, TarArchiveOutputStream taos) throws IOException {
|
||||
File newWorkdir = workdirProvider.createNewWorkdir();
|
||||
File newWorkdir = workdirProvider.createNewWorkdir(service.getRepository().getId());
|
||||
try {
|
||||
File repositoryFile = Files.createFile(Paths.get(newWorkdir.getPath(), "repository")).toFile();
|
||||
try (FileOutputStream repositoryFos = new FileOutputStream(repositoryFile)) {
|
||||
@@ -124,7 +124,7 @@ public class FullScmRepositoryExporter {
|
||||
}
|
||||
|
||||
private void writeStoreData(Repository repository, TarArchiveOutputStream taos) throws IOException {
|
||||
File newWorkdir = workdirProvider.createNewWorkdir();
|
||||
File newWorkdir = workdirProvider.createNewWorkdir(repository.getId());
|
||||
try {
|
||||
File metadata = Files.createFile(Paths.get(newWorkdir.getPath(), "metadata")).toFile();
|
||||
try (FileOutputStream metadataFos = new FileOutputStream(metadata)) {
|
||||
|
||||
Reference in New Issue
Block a user