当前位置: 首页>>代码示例>>Java>>正文


Java ICommonsList.getClone方法代码示例

本文整理汇总了Java中com.helger.commons.collection.impl.ICommonsList.getClone方法的典型用法代码示例。如果您正苦于以下问题:Java ICommonsList.getClone方法的具体用法?Java ICommonsList.getClone怎么用?Java ICommonsList.getClone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.helger.commons.collection.impl.ICommonsList的用法示例。


在下文中一共展示了ICommonsList.getClone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _decompressAttachments

import com.helger.commons.collection.impl.ICommonsList; //导入方法依赖的package包/类
private static void _decompressAttachments (@Nonnull final Ebms3UserMessage aUserMessage,
                                            @Nonnull final IAS4MessageState aState,
                                            @Nonnull final ICommonsList <WSS4JAttachment> aIncomingDecryptedAttachments)
{
  for (final WSS4JAttachment aIncomingAttachment : aIncomingDecryptedAttachments.getClone ())
  {
    final EAS4CompressionMode eCompressionMode = aState.getAttachmentCompressionMode (aIncomingAttachment.getId ());
    if (eCompressionMode != null)
    {
      final IHasInputStream aOldISP = aIncomingAttachment.getInputStreamProvider ();
      aIncomingAttachment.setSourceStreamProvider (new HasInputStream ( () -> {
        try
        {
          return eCompressionMode.getDecompressStream (aOldISP.getInputStream ());
        }
        catch (final IOException ex)
        {
          throw new UncheckedIOException (ex);
        }
      }, aOldISP.isReadMultiple ()));

      final String sAttachmentContentID = StringHelper.trimStart (aIncomingAttachment.getId (), "attachment=");
      // x.getHref() != null needed since, if a message contains a payload and
      // an attachment, it would throw a NullPointerException since a payload
      // does not have anything written in its partinfo therefore also now
      // href
      final Ebms3PartInfo aPart = CollectionHelper.findFirst (aUserMessage.getPayloadInfo ().getPartInfo (),
                                                              x -> x.getHref () != null &&
                                                                   x.getHref ().contains (sAttachmentContentID));
      if (aPart != null)
      {
        final Ebms3Property aProperty = CollectionHelper.findFirst (aPart.getPartProperties ().getProperty (),
                                                                    x -> x.getName ()
                                                                          .equals (UserMessageCreator.PART_PROPERTY_MIME_TYPE));
        if (aProperty != null)
        {
          aIncomingAttachment.overwriteMimeType (aProperty.getValue ());
        }
      }
    }
  }
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:43,代码来源:AS4Handler.java


注:本文中的com.helger.commons.collection.impl.ICommonsList.getClone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。