return;
}
User user = getUser(request);
Vertex userVertex = ((SecureGraphUserRepository) getUserRepository()).findByIdUserVertex(user.getUserId());
GraphRestore graphRestore = new GraphRestore();
for (Part part : request.getParts()) {
if (part.getName().equals("workspace")) {
File outFile = File.createTempFile("lumifyWorkspaceImport", "lumifyworkspace");
copyPartToFile(part, outFile);
String workspaceId = getWorkspaceId(outFile);
Authorizations authorizations = getUserRepository().getAuthorizations(user, UserRepository.VISIBILITY_STRING, WorkspaceRepository.VISIBILITY_STRING, workspaceId);
InputStream in = new FileInputStream(outFile);
try {
graphRestore.restore(graph, in, authorizations);
Vertex workspaceVertex = this.workspaceRepository.getVertex(workspaceId, user);
this.workspaceRepository.addWorkspaceToUser(workspaceVertex, userVertex, authorizations);
} finally {
graph.flush();