This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit a4981c9a authored by Daniel Crazzolara's avatar Daniel Crazzolara
Browse files

Trying potential fix

parent f7c24d75
Branches
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -329,15 +329,15 @@ public class SearchService {
throw e;
}
}
ZipInputStream project = shoppingBasketService.rePackageGitLabProjectZip(
InputStream project = shoppingBasketService.rePackageGitLabProjectZip(
new ZipInputStream(repositoryArchive),
"from project " + exerciseId.getProjectId(),
filter,
exerciseId.getPath()
);
if (recursive == ExtractionDepth.JUST_PROJECT) return project; else {
if (recursive == ExtractionDepth.JUST_PROJECT) return new ZipInputStream(project); else {
alreadyTreatedExerciseIds.add(exerciseId); // Side effects are always dangerous :-(
return extendZipByChildren(exerciseId, project, user, recursive, alreadyTreatedExerciseIds);
return extendZipByChildren(exerciseId, new ZipInputStream(project), user, recursive, alreadyTreatedExerciseIds);
}
} catch (GitLabApiException exception) {
log.error(exception.getMessage());
......
......@@ -319,7 +319,7 @@ public class ShoppingBasketService {
* @return
* @throws IOException
*/
protected ZipInputStream rePackageGitLabProjectZip(
protected InputStream rePackageGitLabProjectZip(
ZipInputStream zipIn,
String originalLocation,
String[] filterOut,
......@@ -359,15 +359,14 @@ public class ShoppingBasketService {
zipInEntry = zipIn.getNextEntry();
}
zipIn.close();
zipOut.close();
} catch (IOException e) {
log.error("Cannot rezip file from {}", originalLocation);
log.error("Cannot rezip file from {}", originalLocation, e);
}
};
new Thread(rePackage).start();
return new ZipInputStream(pis);
return pis;
}
public String getExerciseFolderPath(String exercisesPath) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment