< prev index next >
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -48,10 +48,12 @@
public final class MimePartDataSource implements DataSource {
private final MimeBodyPart part;
/**
* Constructor, that constructs a DataSource from a MimeBodyPart.
+ *
+ * @param part body part
*/
public MimePartDataSource(MimeBodyPart part) {
this.part = part;
}
@@ -66,10 +68,11 @@
* using the <code>getContentStream()</code> method and decodes
* it using the <code>MimeUtility.decode()</code> method.
*
* @return decoded input stream
*/
+ @Override
public InputStream getInputStream() throws IOException {
try {
InputStream is = part.getContentStream();
@@ -86,29 +89,32 @@
/**
* DataSource method to return an output stream. <p>
*
* This implementation throws the UnknownServiceException.
*/
+ @Override
public OutputStream getOutputStream() throws IOException {
throw new UnknownServiceException();
}
/**
* Returns the content-type of this DataSource. <p>
*
* This implementation just invokes the <code>getContentType</code>
* method on the MimeBodyPart.
*/
+ @Override
public String getContentType() {
return part.getContentType();
}
/**
* DataSource method to return a name. <p>
*
* This implementation just returns an empty string.
*/
+ @Override
public String getName() {
try {
return part.getFileName();
} catch (MessagingException mex) {
return "";
< prev index next >