Examples of TryInflaterInputStream


Examples of io.lumify.palantir.dataImport.util.TryInflaterInputStream

    }

    @Override
    protected void processRow(PtMediaAndValue row) throws Exception {
        String propertyKey = getDataImporter().getIdPrefix() + row.getId();
        InputStream in = new TryInflaterInputStream(row.getContents());
        try {
            StreamingPropertyValue propertyValue = new StreamingPropertyValue(in, byte[].class);
            propertyValue.store(true);
            propertyValue.searchIndex(false);

            String title = row.getTitle();
            if (title == null) {
                title = "";
            }

            VertexBuilder vertexBuilder = getDataImporter().getGraph().prepareVertex(getMediaId(row), getDataImporter().getVisibility());
            LumifyProperties.RAW.addPropertyValue(vertexBuilder, propertyKey, propertyValue, getDataImporter().getVisibility());
            LumifyProperties.TITLE.setProperty(vertexBuilder, title, getDataImporter().getVisibility());
            Vertex mediaVertex = vertexBuilder.save(getDataImporter().getAuthorizations());

            Vertex sourceVertex = getVertexCache().get(getObjectVertexId(row.getLinkObjectId()));
            checkNotNull(sourceVertex, "Could not find source vertex for media object: " + row.getLinkObjectId());

            String edgeId = getEdgeId(row);
            String edgeLabel = getEdgeLabel(row);
            getDataImporter().getGraph().addEdge(edgeId, sourceVertex, mediaVertex, edgeLabel, getDataImporter().getVisibility(), getDataImporter().getAuthorizations());
        } finally {
            in.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.