org.apache.directory.api.util.Strings.utf8ToString()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中org.apache.directory.api.util.Strings.utf8ToString()方法的一些代码示例,展示了Strings.utf8ToString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Strings.utf8ToString()方法的具体详情如下:
包路径:org.apache.directory.api.util.Strings
类名称:Strings
方法名:utf8ToString

Strings.utf8ToString介绍

[英]Return an UTF-8 encoded String
[中]返回UTF-8编码的字符串

代码示例

代码示例来源:origin: org.apache.directory.api/api-ldap-model

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

throw new InvalidNameException( I18n.err( I18n.ERR_17037_MUST_START_WITH_SHARP ) );
  throw new InvalidNameException( I18n.err( I18n.ERR_17038_MUST_START_WITH_ESC_SHARP, str ) );
return Strings.utf8ToString( decoded );

代码示例来源:origin: org.apache.directory.server/apacheds-protocol-ldap

private ResultCodeEnum handleSearchResultDone( SearchResultDone searchDone )
{
  CONSUMER_LOG.debug( "///////////////// handleSearchDone //////////////////" );
  SyncDoneValue ctrl = ( SyncDoneValue ) searchDone.getControls().get( SyncDoneValue.OID );
  if ( ( ctrl != null ) && ( ctrl.getCookie() != null ) )
  {
    syncCookie = ctrl.getCookie();
    CONSUMER_LOG.debug( "assigning cookie from sync done value control: " + Strings.utf8ToString( syncCookie ) );
    storeCookie();
  }
  CONSUMER_LOG.debug( "//////////////// END handleSearchDone//////////////////////" );
  reload = false;
  return searchDone.getLdapResult().getResultCode();
}

代码示例来源:origin: org.apache.directory.api/api-all

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

public void action( CertGenerationContainer container )
  {
    BerValue value = container.getCurrentTLV().getValue();
    String keyAlgorithm = Strings.utf8ToString( value.getData() );
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_08218_KEY_ALGORITHM, keyAlgorithm ) );
    }
    if ( keyAlgorithm != null && ( keyAlgorithm.trim().length() > 0 ) )
    {
      container.getCertGenerationRequest().setKeyAlgorithm( keyAlgorithm );
    }
    container.setGrammarEndAllowed( true );
  }
} );

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 * Sets the User Provided ID as a byte[]
 * 
 * @param upId The User Provided ID
 * @param attributeType The asscoiated AttributeType
 */
public void setUpId( byte[] upId, AttributeType attributeType )
{
  byte[] trimmed = Strings.trim( upId );
  if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) )
  {
    throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) );
  }
  String newId = Strings.toLowerCase( trimmed );
  setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );

代码示例来源:origin: org.apache.directory.api/api-all

public void action( CertGenerationContainer container )
  {
    BerValue value = container.getCurrentTLV().getValue();
    String keyAlgorithm = Strings.utf8ToString( value.getData() );
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_08218_KEY_ALGORITHM, keyAlgorithm ) );
    }
    if ( keyAlgorithm != null && ( keyAlgorithm.trim().length() > 0 ) )
    {
      container.getCertGenerationRequest().setKeyAlgorithm( keyAlgorithm );
    }
    container.setGrammarEndAllowed( true );
  }
} );

代码示例来源:origin: org.apache.directory.api/api-ldap-model

/**
 * Sets the User Provided ID as a byte[]
 * 
 * @param upId The User Provided ID
 * @param attributeType The asscoiated AttributeType
 */
public void setUpId( byte[] upId, AttributeType attributeType )
{
  byte[] trimmed = Strings.trim( upId );
  if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) )
  {
    throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) );
  }
  String newId = Strings.toLowerCase( trimmed );
  setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-model

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );
  LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, value ) );

代码示例来源:origin: org.apache.directory.api/api-ldap-extras-codec

public void action( CertGenerationContainer container )
  {
    BerValue value = container.getCurrentTLV().getValue();
    String keyAlgorithm = Strings.utf8ToString( value.getData() );
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_08218_KEY_ALGORITHM, keyAlgorithm ) );
    }
    if ( keyAlgorithm != null && ( keyAlgorithm.trim().length() > 0 ) )
    {
      container.getCertGenerationRequest().setKeyAlgorithm( keyAlgorithm );
    }
    container.setGrammarEndAllowed( true );
  }
} );

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * Sets the User Provided ID as a byte[]
 * 
 * @param upId The User Provided ID
 * @param attributeType The asscoiated AttributeType
 */
public void setUpId( byte[] upId, AttributeType attributeType )
{
  byte[] trimmed = Strings.trim( upId );
  if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) )
  {
    throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) );
  }
  String newId = Strings.toLowerCase( trimmed );
  setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType );
}

代码示例来源:origin: org.apache.directory.api/api-all

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );

代码示例来源:origin: org.apache.directory.api/api-all

@Override
public void action( SortRequestContainer container ) throws DecoderException
{
  BerValue value = container.getCurrentTLV().getValue();
  String matchingRuleOid = Strings.utf8ToString( value.getData() );
  if ( LOG.isDebugEnabled() )
  {
    LOG.debug( I18n.msg( I18n.MSG_05309_MATCHING_RULE_OID, matchingRuleOid ) );
  }
  container.getCurrentKey().setMatchingRuleId( matchingRuleOid );
  container.setGrammarEndAllowed( true );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-extras-codec-api

String str = Strings.utf8ToString( ( byte[] ) obj );
String type = ( String ) getParameterTypeString( index );
    throw new RuntimeException( I18n.err( I18n.ERR_9200_INTERGER_DECODING_FAILURE,
      Strings.dumpBytes( ( byte[] ) obj ) ), e );

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

@Override
public void action( SortRequestContainer container ) throws DecoderException
{
  BerValue value = container.getCurrentTLV().getValue();
  String matchingRuleOid = Strings.utf8ToString( value.getData() );
  if ( LOG.isDebugEnabled() )
  {
    LOG.debug( I18n.msg( I18n.MSG_05309_MATCHING_RULE_OID, matchingRuleOid ) );
  }
  container.getCurrentKey().setMatchingRuleId( matchingRuleOid );
  container.setGrammarEndAllowed( true );
}

代码示例来源:origin: org.apache.directory.api/api-all

public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException
  {
    SearchRequestDecorator searchRequest = container.getMessage();
    TLV tlv = container.getCurrentTLV();
    // Store the value.
    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter )
      searchRequest.getTerminalFilter();
    if ( tlv.getLength() == 0 )
    {
      String msg = I18n.err( I18n.ERR_05001_EMPTY_MATCHING_RULE );
      LOG.error( msg );
      // It will generate a PROTOCOL_ERROR
      throw new DecoderException( msg );
    }
    else
    {
      extensibleMatchFilter.setMatchingRule( Strings.utf8ToString( tlv.getValue().getData() ) );
    }
  }
} );

代码示例来源:origin: org.apache.directory.api/api-all

LOG.debug( I18n.err( I18n.ERR_13210_SYNTAX_INVALID, "null" ) );
strValue = Strings.utf8ToString( ( byte[] ) value );

代码示例来源:origin: org.apache.directory.api/api-all

@Override
  public void action( SortResponseContainer container ) throws DecoderException
  {
    BerValue value = container.getCurrentTLV().getValue();
    String atType = Strings.utf8ToString( value.getData() );
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_05310_ATTRIBUTE_TYPE, atType ) );
    }
    
    container.getControl().setAttributeName( atType );
    container.setGrammarEndAllowed( true );
  }
} );

相关文章