org.apache.cxf.message.Attachment.getDataHandler()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(102)

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

Attachment.getDataHandler介绍

暂无

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public boolean addAll(Collection<? extends Attachment> c) {
  boolean b = false;
  for (Iterator<? extends Attachment> it = c.iterator(); it.hasNext();) {
    Attachment o = it.next();
    if (!attachments.containsKey(o.getId())) {
      b = true;
      attachments.put(o.getId(), o.getDataHandler());
      cache.put(o.getId(), o);
    }
  }
  return b;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public boolean add(Attachment e) {
  if (!attachments.containsKey(e.getId())) {
    attachments.put(e.getId(), e.getDataHandler());
    cache.put(e.getId(), e);
    return true;
  }
  return false;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

if (writingHeaders) {
  writingHeaders = false;
  current = att.getDataHandler().getInputStream();
} else if (atts.hasNext()) {
  att = atts.next();

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

DataHandler dh = a.getDataHandler();
String ct = dh.getContentType();
Object o = null;

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

if (atts != null) {
  for (Attachment a : atts) {
    if (a.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
      try {
        ((AttachmentDataSource)a.getDataHandler().getDataSource()).cache(inMessage);
      } catch (IOException e) {
        throw new Fault(e);

代码示例来源:origin: org.apache.cxf/cxf-core

public boolean containsValue(Object value) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (value.equals(at.getDataHandler())) {
      return true;
    }
  }
  return false;
}

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

public boolean containsValue(Object value) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (value.equals(at.getDataHandler())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: apache/cxf

public boolean containsValue(Object value) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (value.equals(at.getDataHandler())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: apache/cxf

@Override
protected Object readAttachment(Attachment att, Context context) throws IOException {
  DataHandler handler = att.getDataHandler();
  InputStream is = handler.getInputStream();
  // try
  // {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  copy(is, out);
  is.close();
  return out.toByteArray();
}

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

public DataHandler get(Object key) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (key.equals(at.getId())) {
      return at.getDataHandler();
    }
  }
  return null;
}

代码示例来源:origin: apache/cxf

public DataHandler get(Object key) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (key.equals(at.getId())) {
      return at.getDataHandler();
    }
  }
  return null;
}

代码示例来源:origin: org.apache.cxf/cxf-core

public DataHandler get(Object key) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (key.equals(at.getId())) {
      return at.getDataHandler();
    }
  }
  return null;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

@Override
protected Object readAttachment(Attachment att, Context context) throws IOException {
  DataHandler handler = att.getDataHandler();
  InputStream is = handler.getInputStream();
  // try
  // {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  copy(is, out);
  is.close();
  return out.toByteArray();
}

代码示例来源:origin: apache/cxf

public boolean addAll(Collection<? extends Attachment> c) {
  boolean b = false;
  for (Iterator<? extends Attachment> it = c.iterator(); it.hasNext();) {
    Attachment o = it.next();
    if (!attachments.containsKey(o.getId())) {
      b = true;
      attachments.put(o.getId(), o.getDataHandler());
      cache.put(o.getId(), o);
    }
  }
  return b;
}

代码示例来源:origin: apache/cxf

public DataHandler remove(Object key) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (key.equals(at.getId())) {
      collection.remove(at);
      return at.getDataHandler();
    }
  }
  return null;
}
public DataHandler put(String key, DataHandler value) {

代码示例来源:origin: apache/cxf

public boolean add(Attachment e) {
  if (!attachments.containsKey(e.getId())) {
    attachments.put(e.getId(), e.getDataHandler());
    cache.put(e.getId(), e);
    return true;
  }
  return false;
}

代码示例来源:origin: org.apache.cxf/cxf-core

public DataHandler remove(Object key) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (key.equals(at.getId())) {
      collection.remove(at);
      return at.getDataHandler();
    }
  }
  return null;
}
public DataHandler put(String key, DataHandler value) {

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

public DataHandler remove(Object key) {
  Iterator<Attachment> it = collection.iterator();
  while (it.hasNext()) {
    Attachment at = it.next();
    if (key.equals(at.getId())) {
      collection.remove(at);
      return at.getDataHandler();
    }
  }
  return null;
}
public DataHandler put(String key, DataHandler value) {

代码示例来源:origin: org.apache.camel/camel-cxf

private DefaultAttachment createCamelAttachment(Attachment attachment) {
  DefaultAttachment camelAttachment = new DefaultAttachment(attachment.getDataHandler());
  Iterator<String> headers = attachment.getHeaderNames();
  while (headers.hasNext()) {
    String name = headers.next();
    camelAttachment.addHeader(name, attachment.getHeader(name));
  }
  return camelAttachment;
}

代码示例来源:origin: apache/cxf

public void handleMessage(Message message) throws Fault {
  Assert.assertEquals("check attachment count", 1, message.getAttachments().size());
  Attachment att = message.getAttachments().iterator().next();
  Assert.assertNotNull("Attachment is null", att);
  Assert.assertNotNull("Attachment content-type is null", att.getDataHandler().getDataSource()
      .getContentType());
}

相关文章