Tabnine Logo
Property.getStream
Code IndexAdd Tabnine to your IDE (free)

How to use
getStream
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.getStream (Showing top 20 results out of 315)

origin: org.apache.sling/org.apache.sling.scripting.javascript

public Object jsGet_stream() {
  try {
    return property.getStream();
  } catch (RepositoryException re) {
    return Undefined.instance;
  }
}
origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public InputStream getStream() throws ValueFormatException, RepositoryException {
  return property.getStream();
}
origin: net.adamcin.oakpal/oakpal-core

@Override
public InputStream getStream() throws RepositoryException {
  return delegate.getStream();
}
origin: net.adamcin.commons/net.adamcin.commons.jcr

public InputStream getStream() throws RepositoryException
{ return this.item.getStream(); }
origin: info.magnolia/magnolia-module-workflow

private FlowExpression deserializeExpressionAsXml(final Node c) throws Exception {
  if (!c.hasProperty(WorkflowConstants.NODEDATA_VALUE)) {
    return null;
  }
  final InputStream is = c.getProperty(WorkflowConstants.NODEDATA_VALUE).getStream();
  final SAXBuilder builder = new SAXBuilder();
  final Document doc = builder.build(is);
  return (FlowExpression) XmlBeanCoder.xmlDecode(doc);
}
origin: apache/jackrabbit-oak

@Override
public void runTest() throws Exception {
  for (int i = 0; i < FILE_COUNT; i++) {
    Node file = root.getNode("file" + i);
    Node content = file.getNode("jcr:content");
    InputStream stream = content.getProperty("jcr:data").getStream();
    try {
      ByteStreams.copy(stream, ByteStreams.nullOutputStream());
    } finally {
      stream.close();
    }
  }
}
origin: org.openl.rules/org.openl.rules.repository.jcr

protected static InputStream getFileNodeContent(Node node) throws RRepositoryException {
  try {
    return node.getNode(ArtefactProperties.PROP_RES_CONTENT).getProperty(ArtefactProperties.PROP_RES_DATA).getStream();
  } catch (RepositoryException e) {
    throw new RRepositoryException("Failed to get Content!", e);
  }
}
origin: info.magnolia/magnolia-core

@Override
public InputStream getStream() throws ValueFormatException, RepositoryException {
  return getWrappedProperty().getStream();
}
origin: openl-tablets/openl-tablets

protected static InputStream getFileNodeContent(Node node) throws RRepositoryException {
  try {
    return node.getNode(ArtefactProperties.PROP_RES_CONTENT).getProperty(ArtefactProperties.PROP_RES_DATA).getStream();
  } catch (RepositoryException e) {
    throw new RRepositoryException("Failed to get Content!", e);
  }
}
origin: brix-cms/brix-cms

  public InputStream execute() throws Exception {
    return getDelegate().getStream();
  }
});
origin: apache/jackrabbit

/**
 * Tests the failure of calling Property.getStream() on a multivalue
 * property.
 */
public void testMultiValue() throws RepositoryException, IOException {
  if (multiple) {
    InputStream in = null;
    try {
      in = prop.getStream();
      fail("Calling getStream() on a multivalue property " +
          "should throw a ValueFormatException.");
    } catch (ValueFormatException vfe) {
      // ok
    } finally {
      if (in != null) {
        in.close();
      }
    }
  }
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * InputStream)</code> works with <code>Session.save()</code>
 */
public void testNewInputStreamPropertySession() throws Exception {
  testNode.setProperty(propertyName1, is1);
  superuser.save();
  is1 = new ByteArrayInputStream(bytes1);
  InputStream in = testNode.getProperty(propertyName1).getStream();
  try {
    assertTrue("Setting property with Node.setProperty(String, InputStream) and Session.save() not working",
        compareInputStreams(is1, in));
  } finally {
    try { in.close(); } catch (IOException ignore) {}
   }
}
origin: apache/jackrabbit

/**
 * Tests if adding a property with <code>Node.setProperty(String,
 * InputStream)</code> works with <code>parentNode.save()</code>
 */
public void testNewInputStreamPropertyParent() throws Exception {
  testNode.setProperty(propertyName1, is1);
  testRootNode.getSession().save();
  is1 = new ByteArrayInputStream(bytes1);
  InputStream in = testNode.getProperty(propertyName1).getStream();
  try {
    assertTrue("Setting property with Node.setProperty(String, InputStream) and parentNode.save() not working",
        compareInputStreams(is1, in));
  } finally {
    try { in.close(); } catch (IOException ignore) {}
  }
}
origin: apache/jackrabbit

/**
 * Tests if modifying a property with <code>Node.setProperty(String,
 * InputStream)</code> works with <code>parentNode.save()</code>
 */
public void testModifyInputStreamPropertyParent() throws Exception {
  testNode.setProperty(propertyName1, is1);
  testRootNode.getSession().save();
  testNode.setProperty(propertyName1, is2);
  testRootNode.getSession().save();
  is2 = new ByteArrayInputStream(bytes2);
  InputStream in = testNode.getProperty(propertyName1).getStream();
  try {
    assertTrue("Modifying property with Node.setProperty(String, InputStream) and parentNode.save() not working",
        compareInputStreams(is2, in));
  } finally {
    try { in.close(); } catch (IOException ignore) {}
   }
}
origin: apache/jackrabbit

/**
 * Checks if the given content node contains a jcr:data property
 * and spools its value to the output stream of the export context.<br>
 * Please note, that subclasses that define a different structure of the
 * content node should create their own
 * {@link  #exportData(ExportContext, boolean, Node) exportData} method.
 *
 * @param context export context
 * @param isCollection <code>true</code> if collection
 * @param contentNode the content node
 * @throws IOException if an I/O error occurs
 */
protected void exportData(ExportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException {
  if (contentNode.hasProperty(JcrConstants.JCR_DATA)) {
    Property p = contentNode.getProperty(JcrConstants.JCR_DATA);
    IOUtil.spool(p.getStream(), context.getOutputStream());
  } // else: stream undefined -> content length was not set
}
origin: info.magnolia/magnolia-core

@Override
public InputStream getStream() {
  if (isExist()) {
    try {
      return getJCRProperty().getStream();
    } catch (RepositoryException e) {
      throw new RuntimeException("Can't read value of nodedata " + toString(), e);
    }
  }
  return null;
}
origin: info.magnolia/magnolia-core

@Override
public InputStream getStream() {
  if (isExist()) {
    try {
      return getJCRProperty().getStream();
    } catch (RepositoryException e) {
      throw new RuntimeException("Can't read value of node data " + toString(), e);
    }
  }
  return null;
}
origin: brix-cms/brix-cms

/**
 * @deprecated
 */
@Deprecated
public InputStream getStream(Property property) throws RepositoryException {
  if (getPrevious() != null) {
    return getPrevious().getStream(property);
  } else {
    return property.getStream();
  }
}
origin: com.github.livesense/org.liveSense.service.xssRemove

public void removeXSSsecurityVulnerability(String parentFolder, String fileName) throws RepositoryException, Exception {
  if (!session.isLive()) session = repository.loginAdministrative(null);
  Node node = session.getRootNode().getNode(parentFolder+"/"+fileName);
  if (isValidMimeType(node)) {
    log.info("Removing XSS Vulnerability codes for node {}", node.getPath());
    StringWriter sw = new StringWriter();
    XMLWriter xmlWriter = new XMLWriter(sw);
    xmlWriter.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes");
    xmlWriter.setOutputProperty(XMLWriter.ENCODING, configurator.getEncoding());
    parser.setContentHandler(xmlWriter);
    parser.parse(new InputSource(new InputStreamReader(node.getNode("jcr:content").getProperty("jcr:data").getStream(), configurator.getEncoding())));
    node.getNode("jcr:content").setProperty("jcr:data", new ByteArrayInputStream(sw.toString().getBytes(configurator.getEncoding())));
  } else {
    log.info("No XSS  Vulnerability remove, not a HTML: {} - {}", node.getPath(), node.getNode("jcr:content").getProperty("jcr:mimeType"));
  }
  session.save();
}
origin: apache/jackrabbit

public void testGetStream() throws RepositoryException, IOException {
  InputStream in = prop.getStream();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  IOUtils.copy(in, out);
  IOUtils.closeQuietly(in);
  assertEquals(prop.getString(), new String(out.toByteArray(), "UTF-8"));
}
javax.jcrPropertygetStream

Javadoc

Returns an InputStream representation of the value of this property. A shortcut for Property.getValue().getStream().

It is the responsibility of the caller to close the returned InputStream.

Popular methods of Property

  • getString
    Returns a String representation of the value of this property. A shortcut for Property.getValue().g
  • getValues
    Returns an array of all the values of this property. Used to access multi-value properties. The arra
  • getValue
    Returns the value of this property as a Value object. The object returned is a copy of the stored va
  • getName
  • getType
    Returns the type of this Property. One of: * PropertyType.STRING * PropertyType.BINARY * Property
  • getBinary
    Returns a Binary representation of the value of this property. A shortcut for Property.getValue().g
  • getBoolean
    Returns a boolean representation of the value of this property. A shortcut for Property.getValue().
  • remove
  • isMultiple
    Returns true if this property is multi-valued andfalse if this property is single-valued.
  • getDate
    Returns a Calendar representation of the value of this property. A shortcut for Property.getValue()
  • getLong
    Returns a long representation of the value of this property. A shortcut for Property.getValue().get
  • getDefinition
    Returns the property definition that applies to this property. In some cases there may appear to be
  • getLong,
  • getDefinition,
  • setValue,
  • getParent,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • getSession

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Reference (javax.naming)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now