< prev index next >
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 41,61 ****
/**
* Return the DataFlavors for this <code>DataContentHandler</code>.
*
* @return The DataFlavors
*/
public DataFlavor[] getTransferDataFlavors() { // throws Exception;
return new DataFlavor[] { myDF };
}
/**
* Return the Transfer Data of type DataFlavor from InputStream.
*
* @param df The DataFlavor
! * @param ins The InputStream corresponding to the data
* @return String object
*/
public Object getTransferData(DataFlavor df, DataSource ds) {
// use myDF.equals to be sure to get ActivationDataFlavor.equals,
// which properly ignores Content-Type parameters in comparison
if (myDF.equals(df))
return getContent(ds);
--- 41,63 ----
/**
* Return the DataFlavors for this <code>DataContentHandler</code>.
*
* @return The DataFlavors
*/
+ @Override
public DataFlavor[] getTransferDataFlavors() { // throws Exception;
return new DataFlavor[] { myDF };
}
/**
* Return the Transfer Data of type DataFlavor from InputStream.
*
* @param df The DataFlavor
! * @param ds The DataSource
* @return String object
*/
+ @Override
public Object getTransferData(DataFlavor df, DataSource ds) {
// use myDF.equals to be sure to get ActivationDataFlavor.equals,
// which properly ignores Content-Type parameters in comparison
if (myDF.equals(df))
return getContent(ds);
*** 63,73 ****
--- 65,79 ----
return null;
}
/**
* Return the content.
+ *
+ * @param ds The DataSource
+ * @return content
*/
+ @Override
public Object getContent(DataSource ds) {
try {
return new MimeMultipart(
ds, new ContentType(ds.getContentType()));
} catch (Exception e) {
*** 76,85 ****
--- 82,92 ----
}
/**
* Write the object to the output stream, using the specific MIME type.
*/
+ @Override
public void writeTo(Object obj, String mimeType, OutputStream os)
throws IOException {
if (obj instanceof MimeMultipart) {
try {
//TODO: temporarily allow only ByteOutputStream
< prev index next >