/** * @param udfPath the absolute path of the root node where UDF files are sequenced (can be <code>null</code> or empty if * {@link #UDF_PATH_PROPERTY} or the default path should be used) */ public void setUdfPath( final String udfPath ) { this.udfPath = ( StringUtil.isBlank( udfPath ) ? null : udfPath ); }
/** * {@inheritDoc} * * @see org.teiid.modeshape.sequencer.Result#wasSuccessful() */ @Override public boolean wasSuccessful() { return ( ( this.error == null ) && StringUtil.isBlank( this.errorMsg ) ); }
/** * Returns true if the given string is not null and does not represents the empty string * * @param str the string; may be null or empty * @return true if the string is not null and not empty, false otherwise */ public static boolean notBlank( String str ) { return !isBlank(str); }
protected String getSourceCode( final int startPosition, final int length ) { if (StringUtil.isBlank(this.sourceCode)) { return null; } return this.sourceCode.substring(startPosition, (startPosition + length)); }
private void setStringIfNotBlank( Node node, String propertyName, String value ) throws RepositoryException { if (!StringUtil.isBlank(value)) { node.setProperty(propertyName, value); } }
/** * Creates a new {@link org.modeshape.jcr.spi.federation.PageKey} instance which has the given parent ID and the same * offset & block size as this page. * @param parentId a {@link String} representing the ID of the new parent; may not be null. * @return a new {@link org.modeshape.jcr.spi.federation.PageKey} instance; never null. */ public PageKey withParentId(String parentId) { if (StringUtil.isBlank(parentId)) { throw new IllegalArgumentException("Parent ID cannot be empty"); } return new PageKey(parentId, this.offset, this.blockSize); }
/** * Creates a new {@link org.modeshape.jcr.spi.federation.PageKey} instance which has the given parent ID and the same * offset & block size as this page. * @param parentId a {@link String} representing the ID of the new parent; may not be null. * @return a new {@link org.modeshape.jcr.spi.federation.PageKey} instance; never null. */ public PageKey withParentId(String parentId) { if (StringUtil.isBlank(parentId)) { throw new IllegalArgumentException("Parent ID cannot be empty"); } return new PageKey(parentId, this.offset, this.blockSize); }
private Node getConnectionRoot( final Node dataServiceNode ) throws Exception { String path = ( ( this.connectionPath == null ) ? null : this.connectionPath ); if ( StringUtil.isBlank( path ) ) { path = System.getProperty( CONNECTION_PATH_PROPERTY ); } if ( !StringUtil.isBlank( path ) && dataServiceNode.getSession().nodeExists( path ) ) { return dataServiceNode.getSession().getNode( path ); } return dataServiceNode.getParent(); }
private Node getMetadataRoot( final Node dataServiceNode ) throws Exception { String path = ( ( this.metadataPath == null ) ? null : this.metadataPath ); if ( StringUtil.isBlank( path ) ) { path = System.getProperty( METADATA_PATH_PROPERTY ); } if ( !StringUtil.isBlank( path ) && dataServiceNode.getSession().nodeExists( path ) ) { return dataServiceNode.getSession().getNode( path ); } return dataServiceNode.getParent(); }
protected NodeKey createTargetKeyFor( NodeKey sourceKey, NodeKey parentKeyInTarget, String preferredKey ) { NodeKey newKey = sourceToTargetKeys.get(sourceKey); if (newKey != null) { return newKey; } else if (!StringUtil.isBlank(preferredKey)) { return new NodeKey(preferredKey); } else { return parentKeyInTarget.withRandomId(); } }
@Override public void trace( Throwable t, String message, Object... params ) { if (StringUtil.isBlank(message)) { return; } if (!isTraceEnabled()) return; logger.trace(StringUtil.createString(message, params), t); }
@Override public void debug( Throwable t, String message, Object... params ) { if (StringUtil.isBlank(message)) { return; } if (!isDebugEnabled()) return; logger.debug(StringUtil.createString(message, params), t); }
@Override public void trace( String message, Object... params ) { if (StringUtil.isBlank(message)) { return; } if (!isTraceEnabled()) return; logger.trace(StringUtil.createString(message, params)); }
@Override public void trace( String message, Object... params ) { if (StringUtil.isBlank(message)) { return; } if (!isTraceEnabled()) return; logger.trace(StringUtil.createString(message, params)); }
private Integer asInteger(String propertyName) { String value = dsProperties.getProperty(propertyName); if (!StringUtil.isBlank(value)) { return Integer.valueOf(value); } return null; } }
/** * @param change the change being processed * @return <code>true</code> if there is no absolute path or if change path matches or optionally is a deep match */ private boolean acceptBasedOnPath( AbstractNodeChange change ) { if (!StringUtil.isBlank(absPath)) { Path matchPath = session.pathFactory().create(this.absPath); Path parentPath = parentNodePathOfChange(change); return this.isDeep ? matchPath.isAtOrAbove(parentPath) : matchPath.equals(parentPath); } return true; }
/** * @param change the change being processed * @return <code>true</code> if there is no absolute path or if change path matches or optionally is a deep match */ private boolean acceptBasedOnPath( AbstractNodeChange change ) { if (!StringUtil.isBlank(absPath)) { Path matchPath = session.pathFactory().create(this.absPath); Path parentPath = parentNodePathOfChange(change); return this.isDeep ? matchPath.isAtOrAbove(parentPath) : matchPath.equals(parentPath); } return true; }
@Override protected NodeKey createTargetKeyFor( NodeKey sourceKey, NodeKey parentKeyInTarget, String preferredKey ) { // Reuse the same source and identifier, but a different workspace ... return !StringUtil.isBlank(preferredKey) ? new NodeKey(preferredKey) : parentKeyInTarget.withId(sourceKey.getIdentifier()); }
@Override public void evaluate() throws Throwable { StringBuilder messageBuilder = new StringBuilder(description.testCount()); messageBuilder.append("Skipped ").append(description.toString()); if (!StringUtil.isBlank(reason)) { messageBuilder.append(" because: ").append(reason); } System.out.println(messageBuilder.toString()); } };
protected String createName( String uri, String localName ) { return !StringUtil.isBlank(uri) ? nameFactory.create(uri, localName, XML_DECODER).getString(NoOpEncoder.getInstance()) : nameFactory.create(localName, XML_DECODER) .getString(NoOpEncoder.getInstance()); }