Package org.gephi.project.spi

Examples of org.gephi.project.spi.WorkspaceBytesPersistenceProvider


            }
        }
    }

    private void readWorkspaceBytes(InputStream inputstream, Workspace workspace, String providerId) throws Exception {
        WorkspaceBytesPersistenceProvider provider = PersistenceProviderUtils.getBytesPersistenceProviders().get(providerId);

        if (provider != null) {
            DataInputStream stream = null;
            try {
                stream = new DataInputStream(inputstream);
                provider.readBytes(stream, workspace);
            } finally {
                if (stream != null) {
                    stream.close();
                }
            }
View Full Code Here


    }

    private void writeWorkspaceBytes(Workspace workspace, DataOutputStream outputStream, ZipOutputStream zipOut) throws Exception {
        for (Map.Entry<String, WorkspaceBytesPersistenceProvider> entry : PersistenceProviderUtils.getBytesPersistenceProviders().entrySet()) {
            String name = entry.getKey();
            WorkspaceBytesPersistenceProvider provider = entry.getValue();

            //Write Project file
            zipOut.putNextEntry(new ZipEntry("Workspace_" + workspace.getId() + "_" + name + "_bytes"));

            provider.writeBytes(outputStream, workspace);

            //Close Project file
            zipOut.closeEntry();
        }
    }
View Full Code Here

TOP

Related Classes of org.gephi.project.spi.WorkspaceBytesPersistenceProvider

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.