Package org.securegraph.tools

Examples of org.securegraph.tools.GraphRestore


            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();
View Full Code Here

TOP

Related Classes of org.securegraph.tools.GraphRestore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.