congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Property.getLength
Code IndexAdd Tabnine to your IDE (free)

How to use
getLength
method
in
javax.jcr.Property

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

origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public long getLength() throws ValueFormatException, RepositoryException {
  return property.getLength();
}
origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault

/**
 * {@inheritDoc}
 */
public long getContentLength() {
  try {
    return content.getProperty(JcrConstants.JCR_DATA).getLength();
  } catch (RepositoryException e) {
    log.error("Error while retrieving length of " + content, e);
    return -1;
  }
}
origin: org.onehippo.cms7.hst/hst-client

public static long getDataLength(Node resourceNode, String binaryDataPropName) {
  try {
    return resourceNode.getProperty(binaryDataPropName).getLength();
  } catch (RepositoryException e) {
    log.warn("Unable to determine binary data length", e);
  }
  return -1;
}
origin: apache/jackrabbit

public void testDoubleLength() throws RepositoryException {
  node.setProperty(propertyName1, Math.PI);
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}
origin: apache/jackrabbit

/** {@inheritDoc} */
public long getLength() throws RepositoryException, RemoteException {
  try {
    return property.getLength();
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);
  }
}
origin: apache/jackrabbit

public void testStringLength() throws RepositoryException {
  node.setProperty(propertyName1, "abc");
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}

origin: apache/jackrabbit

public void testLongLength() throws RepositoryException {
  node.setProperty(propertyName1, 123);
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}
origin: apache/jackrabbit

public void testDateLength() throws RepositoryException {
  node.setProperty(propertyName1, Calendar.getInstance());
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}
origin: apache/jackrabbit

public void testDecimalLength() throws RepositoryException {
  node.setProperty(propertyName1, new BigDecimal(123));
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}
origin: apache/jackrabbit

public void testLengthDateLiteral() throws RepositoryException {
  node.setProperty(propertyName1, "abc");
  superuser.save();
  Calendar length = Calendar.getInstance();
  length.setTimeInMillis(node.getProperty(propertyName1).getLength());
  executeQueries(propertyName1, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, vf.createValue(length));
}
origin: apache/jackrabbit

public void testLengthDecimalLiteral() throws RepositoryException {
  node.setProperty(propertyName1, "abc");
  superuser.save();
  BigDecimal length = new BigDecimal(node.getProperty(propertyName1).getLength());
  executeQueries(propertyName1, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, vf.createValue(length));
}
origin: apache/jackrabbit

public void testBinaryLength() throws RepositoryException {
  byte[] data = "abc".getBytes();
  Binary b = vf.createBinary(new ByteArrayInputStream(data));
  try {
    node.setProperty(propertyName1, b);
  } finally {
    b.dispose();
  }
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}
origin: info.magnolia/magnolia-core

@Override
public long getContentLength() {
  if (!isExist()) {
    return 0;
  }
  try {
    return getJCRProperty().getLength();
  } catch (RepositoryException re) {
    throw new RuntimeException(re);
  }
}
origin: info.magnolia/magnolia-core

@Override
public long getContentLength() {
  if (!isExist()) {
    return 0;
  }
  try {
    return getJCRProperty().getLength();
  } catch (RepositoryException re) {
    throw new RuntimeException(re);
  }
}
origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault

/**
 * {@inheritDoc}
 */
public long getSize() {
  try {
    assertValid();
    return getData().getLength();
  } catch (RepositoryException e) {
    log.error("Error during getSize()", e);
    return -1;
  }
}
origin: apache/jackrabbit

public void testWeakReferenceLength()
    throws RepositoryException, NotExecutableException {
  ensureMixinType(node, mixReferenceable);
  superuser.save();
  node.setProperty(propertyName1, vf.createValue(node, true));
  superuser.save();
  checkOperators(propertyName1, node.getProperty(propertyName1).getLength());
}
origin: apache/jackrabbit

public void testLengthBinaryLiteral() throws RepositoryException {
  node.setProperty(propertyName1, "abc");
  superuser.save();
  String length = String.valueOf(node.getProperty(propertyName1).getLength());
  Binary b = vf.createBinary(new ByteArrayInputStream(length.getBytes()));
  try {
    executeQueries(propertyName1, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
        vf.createValue(b));
  } finally {
    b.dispose();
  }
}
origin: org.onehippo.cms7/hippo-cms-console-frontend

@Override
public Bytes length() {
  try {
    return Bytes.bytes(model.getProperty().getLength());
  } catch (RepositoryException e) {
    return null;
  }
}
origin: brix-cms/brix-cms

public long getLength(Property property) throws RepositoryException {
  if (getPrevious() != null) {
    return getPrevious().getLength(property);
  } else {
    return property.getLength();
  }
}
origin: apache/jackrabbit-oak

  @Test
  public void validateMigration() throws RepositoryException, IOException {
    verifyContent(session);
    verifyBlob(session);
    assertEquals(0, session.getNode("/libs/sling/xss/config.xml/jcr:content").getProperty("jcr:data").getLength());
  }
}
javax.jcrPropertygetLength

Javadoc

Returns the length of the value of this property.

For a BINARY property, getLength returns the number of bytes. For other property types, getLength returns the same value that would be returned by calling java.lang.String#length() on the value when it has been converted to a STRING according to standard JCR property type conversion.

Returns -1 if the implementation cannot determine the length.

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,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • JCheckBox (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Github Copilot alternatives
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