@@ -156,7 +156,9 @@ public void deleteProject(@PathParam("project") final String projectName)
156
156
157
157
// Now remove the repositories associated with this project.
158
158
List <RepositoryInfo > repos = env .getProjectRepositoriesMap ().get (proj );
159
- env .getRepositories ().removeAll (repos );
159
+ if (repos != null ) {
160
+ env .getRepositories ().removeAll (repos );
161
+ }
160
162
env .getProjectRepositoriesMap ().remove (proj );
161
163
162
164
env .getProjects ().remove (projectName , proj );
@@ -167,9 +169,12 @@ public void deleteProject(@PathParam("project") final String projectName)
167
169
// Lastly, remove data associated with the project.
168
170
logger .log (Level .INFO , "deleting data for project {0}" , projectName );
169
171
for (String dirName : new String []{IndexDatabase .INDEX_DIR , IndexDatabase .XREF_DIR }) {
170
-
171
- IOUtils .removeRecursive (Paths .get (env .getDataRootPath () +
172
- File .separator + dirName + File .separator + projectName ));
172
+ java .nio .file .Path path = Paths .get (env .getDataRootPath (),dirName , projectName );
173
+ try {
174
+ IOUtils .removeRecursive (path );
175
+ } catch (IOException e ) {
176
+ logger .log (Level .WARNING , "Could not delete {0}" , path .toString ());
177
+ }
173
178
}
174
179
HistoryGuru guru = HistoryGuru .getInstance ();
175
180
guru .removeCache (repos .stream ().
0 commit comments